home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_usrdoc / PCMCIA-C.{1O / PCMCIA-H.{_6 < prev    next >
Text File  |  1999-09-17  |  129KB  |  2,798 lines

  1.   Linux PCMCIA HOWTO
  2.   David Hinds, dhinds@hyper.stanford.edu.
  3.   v2.25, 1998/11/17 08:05:43
  4.  
  5.   This document describes how to install and use PCMCIA Card Services
  6.   for Linux, and answers some frequently asked questions.  The latest
  7.   version of this document can always be found at <ftp://hyper.stan-
  8.   ford.edu/pub/pcmcia/doc>.  An HTML version is at <http://hyper.stan-
  9.   ford.edu/HyperNews/get/pcmcia/home.html>.
  10.   ______________________________________________________________________
  11.  
  12.   Table of Contents:
  13.  
  14.   1.      General information and hardware requirements
  15.  
  16.   1.1.    Introduction
  17.  
  18.   1.2.    Copyright notice and disclaimer
  19.  
  20.   1.3.    What is the latest version, and where can I get it?
  21.  
  22.   1.4.    What systems are supported?
  23.  
  24.   1.5.    What cards are supported?
  25.  
  26.   1.6.    When will my favorite (unsupported) card become supported?
  27.  
  28.   1.7.    Mailing lists and other information sources
  29.  
  30.   1.8.    Why don't you distribute binaries?
  31.  
  32.   1.9.    Why is the package so darned big?
  33.  
  34.   2.      Compilation and installation
  35.  
  36.   2.1.    Prerequisites and kernel setup
  37.  
  38.   2.2.    Installation
  39.  
  40.   2.3.    Startup options
  41.  
  42.   2.4.    System resource settings
  43.  
  44.   2.5.    Notes about specific Linux distributions
  45.  
  46.   2.5.1.  Debian
  47.  
  48.   2.5.2.  Red Hat, and Caldera Open Desktop
  49.  
  50.   2.5.3.  Slackware
  51.  
  52.   2.5.4.  SuSE
  53.  
  54.   3.      Resolving installation and configuration problems
  55.  
  56.   3.1.    Base PCMCIA kernel modules do not load
  57.  
  58.   3.2.    Some client driver modules do not load
  59.  
  60.   3.3.    Interrupt scan failures
  61.  
  62.   3.4.    IO port scan failures
  63.  
  64.   3.5.    Memory probe failures
  65.  
  66.   3.6.    Failure to detect card insertions and removals
  67.  
  68.   3.7.    System resource starvation
  69.  
  70.   3.8.    Resource conflict between two cards
  71.  
  72.   3.9.    Device configuration does not complete
  73.  
  74.   4.      Usage and features
  75.  
  76.   4.1.    Tools for configuring and monitoring PCMCIA devices
  77.  
  78.   4.1.1.  The cardmgr configuration daemon
  79.  
  80.   4.1.2.  The cardctl and cardinfo utilities
  81.  
  82.   4.1.3.  Inserting and ejecting cards
  83.  
  84.   4.1.4.  Card Services and Advanced Power Management
  85.  
  86.   4.1.5.  Shutting down the PCMCIA system
  87.  
  88.   4.2.    Overview of the PCMCIA configuration scripts
  89.  
  90.   4.3.    PCMCIA network adapters
  91.  
  92.   4.3.1.  Network device parameters
  93.  
  94.   4.3.2.  Comments about specific cards
  95.  
  96.   4.3.3.  Diagnosing problems with network adapters
  97.  
  98.   4.4.    PCMCIA serial and modem devices
  99.  
  100.   4.4.1.  Serial device parameters
  101.  
  102.   4.4.2.  Diagnosing problems with serial devices
  103.  
  104.   4.5.    PCMCIA SCSI adapters
  105.  
  106.   4.5.1.  SCSI device parameters
  107.  
  108.   4.5.2.  Comments about specific cards
  109.  
  110.   4.5.3.  Diagnosing problems with SCSI adapters
  111.  
  112.   4.6.    PCMCIA memory cards
  113.  
  114.   4.6.1.  Memory device parameters
  115.  
  116.   4.6.2.  Using flash memory cards
  117.  
  118.   4.7.    PCMCIA ATA/IDE card drives
  119.  
  120.   4.7.1.  ATA/IDE fixed-disk device parameters
  121.  
  122.   4.7.2.  Diagnosing problems with ATA/IDE adapters
  123.  
  124.   4.8.    Multifunction cards
  125.  
  126.   5.      Advanced topics
  127.  
  128.   5.1.    Resource allocation for PCMCIA devices
  129.  
  130.   5.2.    How can I have separate device setups for home and work?
  131.  
  132.   5.3.    Booting from a PCMCIA device
  133.  
  134.   5.3.1.  The pcinitrd helper script
  135.  
  136.   5.3.2.  Creating an initrd boot floppy
  137.  
  138.   5.3.3.  Installing an initrd image on a non-Linux drive
  139.  
  140.   6.      Dealing with unsupported cards
  141.  
  142.   6.1.    Configuring unrecognized cards
  143.  
  144.   6.2.    Adding support for an NE2000-compatible ethernet card
  145.  
  146.   6.3.    PCMCIA floppy interface cards
  147.  
  148.   6.4.    What's up with support for Xircom cards?
  149.  
  150.   7.      Debugging tips and programming information
  151.  
  152.   7.1.    Submitting useful bug reports
  153.  
  154.   7.2.    Interpreting kernel trap reports
  155.  
  156.   7.3.    Low level PCMCIA debugging aids
  157.  
  158.   7.4.    /proc/bus/pccard
  159.  
  160.   7.5.    Writing Card Services drivers for new cards
  161.  
  162.   7.6.    Guidelines for PCMCIA client driver authors
  163.  
  164.   7.7.    Guidelines for Linux distribution maintainers
  165.   ______________________________________________________________________
  166.  
  167.   11..  GGeenneerraall iinnffoorrmmaattiioonn aanndd hhaarrddwwaarree rreeqquuiirreemmeennttss
  168.  
  169.   11..11..  IInnttrroodduuccttiioonn
  170.  
  171.   Card Services for Linux is a complete PCMCIA or ``PC Card'' support
  172.   package.  It includes a set of loadable kernel modules that implement
  173.   a version of the Card Services applications program interface, a set
  174.   of client drivers for specific cards, and a card manager daemon that
  175.   can respond to card insertion and removal events, loading and
  176.   unloading drivers on demand.  It supports ``hot swapping'' of most
  177.   card types, so cards can be safely inserted and ejected at any time.
  178.  
  179.   This software is continually under development.  It probably contains
  180.   bugs, and should be used with caution.  I'll do my best to fix
  181.   problems that are reported to me, but if you don't tell me, I may
  182.   never know.  If you use this code, I hope you will send me your
  183.   experiences, good or bad!
  184.  
  185.   If you have any suggestions for how this document could be improved,
  186.   please let me know (dhinds@hyper.stanford.edu).
  187.  
  188.   11..22..  CCooppyyrriigghhtt nnoottiiccee aanndd ddiissccllaaiimmeerr
  189.  
  190.   Copyright (c) 1998 David A. Hinds
  191.  
  192.   This document may be reproduced or distributed in any form without my
  193.   prior permission.  Modified versions of this document, including
  194.   translations into other languages, may be freely distributed, provided
  195.   that they are clearly identified as such, and this copyright is
  196.   included intact.
  197.   This document may be included in commercial distributions without my
  198.   prior consent.  While it is not required, I would like to be informed
  199.   of such usage.  If you intend to incorporate this document in a
  200.   published work, please contact me to make sure you have the latest
  201.   available version.
  202.  
  203.   This document is provided ``AS IS'', with no express or implied
  204.   warranties.  Use the information in this document at your own risk.
  205.  
  206.   11..33..  WWhhaatt iiss tthhee llaatteesstt vveerrssiioonn,, aanndd wwhheerree ccaann II ggeett iitt??
  207.  
  208.   The current major release of Card Services is version 3.0, and minor
  209.   updates or bug fixes are numbered 3.0.1, 3.0.2, and so on.
  210.  
  211.   Source code for the latest version is available from
  212.   hyper.stanford.edu in the /pub/pcmcia directory, as pcmcia-
  213.   cs-3.0.?.tar.gz.  There will usually be several versions here.  I
  214.   generally only keep the latest minor release for a given major
  215.   release.  New major releases may contain relatively untested code, so
  216.   I also keep the latest version of the previous major release as a
  217.   relatively stable fallback; the current fallback is 2.9.12.  It is up
  218.   to you to decide which version is more appropriate, but the CHANGES
  219.   file will summarize the most important differences.
  220.  
  221.   hyper.stanford.edu is mirrored at sunsite.unc.edu (and all sunsite
  222.   mirror sites) in /pub/Linux/kernel/pcmcia.
  223.  
  224.   If you do not feel up to compiling the drivers from scratch, pre-
  225.   compiled drivers are included with current releases of most of the
  226.   major Linux distributions, including Slackware, Debian, Red Hat,
  227.   Caldera, SuSE, and Yggdrasil, among others.
  228.  
  229.   11..44..  WWhhaatt ssyysstteemmss aarree ssuuppppoorrtteedd??
  230.  
  231.   This package should run on almost Intel-based Linux-capable laptop.
  232.   It also runs on Alpha-based platforms (i.e., the DEC Multia).  Work is
  233.   being done to make the package fully dual-endian, so that it will also
  234.   support PowerPC-based platforms (i.e., Apple Powerbooks).  Most common
  235.   socket controllers are supported.  Card docks for desktop systems
  236.   should work as long as they use a supported controller, and are
  237.   plugged directly into the ISA or PCI bus, as opposed to SCSI-to-PCMCIA
  238.   or IDE-to-PCMCIA adapters.  The following controllers are recognized
  239.   by the supplied socket drivers:
  240.  
  241.   +o  Cirrus Logic PD6710, PD6720, PD6722, PD6729, PD6730, PD6732, PD6832
  242.  
  243.   +o  Intel i82365sl B, C, and DF steps, 82092AA
  244.  
  245.   +o  O2Micro OZ6729, OZ6730, OZ6832, OZ6833, OZ6836, OZ6860
  246.  
  247.   +o  Omega Micro 82C092G
  248.  
  249.   +o  Ricoh RF5C296, RF5C396, RL5C465, RL5C466, RL5C475, RL5C476, RL5C478
  250.  
  251.   +o  SMC 34C90
  252.  
  253.   +o  Texas Instruments PCI1130, PCI1131, PCI1220, PCI1221, PCI1250A
  254.  
  255.   +o  Toshiba ToPIC95, ToPIC97 (experimental)
  256.  
  257.   +o  Vadem VG465, VG468, VG469
  258.  
  259.   +o  VLSI Technologies 82C146, VCF94365
  260.  
  261.   +o  VIA VT83C469
  262.  
  263.   +o  Databook DB86082, DB86082A, DB86084, DB86084A, DB86072, DB86082B
  264.  
  265.   Other controllers that are register compatible with the Intel i82365sl
  266.   will generally work, as well.
  267.  
  268.   Support for 32-bit CardBus cards is still somewhat experimental.
  269.   Drivers prior to version 3.0 only support 16-bit cards in CardBus
  270.   sockets.  Due to the rapid pace of technological change for laptop
  271.   hardware, new controllers appear frequently, and there may be delays
  272.   between when a new model appears on the market, and when driver
  273.   support becomes available.
  274.  
  275.   Toshiba recently made available specifications for their ToPIC95 and
  276.   ToPIC97 chipsets.  Work has been hindered by the fact that much of the
  277.   documentation exists only in Japanese.  Full support for these
  278.   chipsets is still experimental.
  279.  
  280.   The Motorola 6AHC05GA controller used in some Hyundai laptops is not
  281.   supported.  The custom host controller in the HP Omnibook 600 is also
  282.   unsupported.
  283.  
  284.   11..55..  WWhhaatt ccaarrddss aarree ssuuppppoorrtteedd??
  285.  
  286.   The current release includes drivers for a variety of ethernet cards,
  287.   a driver for modem and serial port cards, several SCSI adapter
  288.   drivers, a driver for ATA/IDE drive cards, and memory card drivers
  289.   that should support most SRAM cards and some flash cards.  The
  290.   SUPPORTED.CARDS file included with each release of Card Services lists
  291.   all cards that are known to work in at least one actual system.
  292.  
  293.   The likelihood that a card not on the supported list will work depends
  294.   on the type of card.  Essentially all modems should work with the
  295.   supplied driver.  Some network cards may work if they are OEM versions
  296.   of supported cards.  Other types of IO cards (frame buffers, sound
  297.   cards, etc) will not work until someone writes the appropriate
  298.   drivers.
  299.  
  300.   11..66..  WWhheenn wwiillll mmyy ffaavvoorriittee ((uunnssuuppppoorrtteedd)) ccaarrdd bbeeccoommee ssuuppppoorrtteedd??
  301.  
  302.   Unfortunately, they usually don't pay me to write device drivers, so
  303.   if you would like to have a driver for your favorite card, you are
  304.   probably going to have to do at least some of the work.  Ideally, I'd
  305.   like to work towards a model like the Linux kernel, where I would be
  306.   responsible mainly for the ``core'' driver code and other authors
  307.   would contribute and maintain client drivers for specific cards.  The
  308.   SUPPORTED.CARDS file mentions some cards for which driver work is
  309.   currently in progress.  I will try to help where I can, but be warned
  310.   that debugging kernel device drivers by email is not particularly
  311.   effective.
  312.  
  313.   Manufacturers interested in helping provide Linux support for their
  314.   products can contact me about consulting arrangements.
  315.  
  316.   11..77..  MMaaiilliinngg lliissttss aanndd ootthheerr iinnffoorrmmaattiioonn ssoouurrcceess
  317.  
  318.   I used to maintain a database and mailing list of Linux PCMCIA users.
  319.   More recently, I've turned my web page for Linux PCMCIA information
  320.   into a ``HyperNews'' site, with a set of message lists for Linux
  321.   PCMCIA issues.  There are lists for installation and configuration
  322.   issues, for different types of cards, and for programming and
  323.   debugging issues.  The Linux PCMCIA information page is at
  324.   <http://hyper.stanford.edu/HyperNews/get/pcmcia/home.html>.  Users can
  325.   request email notification of new responses to particular questions,
  326.   or notification for all new messages in a given category.  I hope that
  327.   this will become a useful repository of information, for questions
  328.   that go beyond the scope of the HOWTO.
  329.  
  330.   There is a Linux mailing list devoted to laptop issues, the ``linux-
  331.   laptop'' list.  For more information, send a message containing the
  332.   word ``help'' to majordomo@vger.rutgers.edu.  To subscribe, send a
  333.   message containing ``subscribe linux-laptop'' to the same address.
  334.   This mailing list might be a good forum for discussion of Linux PCMCIA
  335.   issues.
  336.  
  337.   The Linux Laptop Home Page at
  338.   <http://www.cs.utexas.edu/users/kharker/linux-laptop> has links to
  339.   many sites that have information about configuring specific types of
  340.   laptops for Linux.  There is also a searchable database of system
  341.   configuration information.
  342.  
  343.   11..88..  WWhhyy ddoonn''tt yyoouu ddiissttrriibbuuttee bbiinnaarriieess??
  344.  
  345.   For me, distributing binaries would be a significant hassle.  It is
  346.   complicated because some features can only be selected at compile
  347.   time, and because the modules are somewhat dependent on having the
  348.   ``right'' kernel configuration.  So, I would probably need to
  349.   distribute precompiled modules along with matching kernels.  Beyond
  350.   this, the greatest need for precompiled modules is when installing
  351.   Linux on a clean system.  This typically requires setting up drivers
  352.   so they can be used in the installation process for a particular Linux
  353.   distribution.  Each Linux distribution has its own ideosyncracies, and
  354.   it is not feasible for me to provide boot and root disks for even just
  355.   the common combinations of drivers and distributions.
  356.  
  357.   PCMCIA is now a part of many of the major Linux distributions,
  358.   including Red Hat, Caldera, Slackware, Yggdrasil, Craftworks, and
  359.   Nascent Technology.
  360.  
  361.   11..99..  WWhhyy iiss tthhee ppaacckkaaggee ssoo ddaarrnneedd bbiigg??
  362.  
  363.   Well, first of all, it isn't actually that large.  All the driver
  364.   modules together take up about 500K of disk space.  The utility
  365.   programs add up to about 70K, and the scripts in /etc/pcmcia are about
  366.   50K.  The core driver modules take up about 55K of system memory.  The
  367.   cardmgr daemon will generally be swapped out except when cards are
  368.   inserted or removed.  The total package size is comparable to
  369.   DOS/Windows Card Services implementations.
  370.  
  371.   Compared to DOS ``point enablers'', this may still seem like a lot of
  372.   overhead, especially for people that don't plan on using many of the
  373.   features of PCMCIA, such as power management or hot swapping.  Point
  374.   enablers can be tiny because they generally support only one or a
  375.   small set of cards, and also generally support a restricted set of
  376.   host controllers.  If someone were to write a genuinely ``generic''
  377.   modem enabler, it would end up incorporating much of the functionality
  378.   of Card Services, to handle cards from different vendors and the full
  379.   range of host controller variants.
  380.  
  381.   22..  CCoommppiillaattiioonn aanndd iinnssttaallllaattiioonn
  382.  
  383.   22..11..  PPrreerreeqquuiissiitteess aanndd kkeerrnneell sseettuupp
  384.  
  385.   Before starting, you should think about whether you really need to
  386.   compile the PCMCIA package yourself.  All common Linux distributions
  387.   come with pre-compiled driver packages.  Generally, you only need to
  388.   install the drivers from scratch if you need a new feature of the
  389.   current drivers, or if you've updated and/or reconfigured your kernel
  390.   in a way that is incompatible with the drivers included with your
  391.   Linux distribution.  While compiling the package is not technically
  392.   difficult, it does require some general Linux familiarity.
  393.  
  394.   The following things should be installed on your system before you
  395.   begin:
  396.  
  397.   +o  A 2.0.* or 2.1.* series kernel source tree.
  398.  
  399.   +o  An appropriate set of module utilities.
  400.  
  401.   +o  (Optional) the ``XForms'' X11 user interface toolkit.
  402.  
  403.   The current driver package actually works with most kernel versions
  404.   back to 1.2.8.  However, use with older kernels is deprecated, and
  405.   backwards compatibility with very old kernels may go away at any time.
  406.  
  407.   You need to have a complete linux source tree for your kernel, not
  408.   just an up-to-date kernel image.  The driver modules contain some
  409.   references to kernel source files.  While you may want to build a new
  410.   kernel to remove unnecessary drivers, installing PCMCIA does not
  411.   require you to do so.
  412.  
  413.   Current ``stable'' kernel sources and patches are available from
  414.   <ftp://sunsite.unc.edu/pub/Linux/kernel/v2.0>, or from
  415.   <ftp://tsx-11.mit.edu/pub/linux/sources/system/v2.0>.  Development
  416.   kernels can be found in the corresponding v2.1 subdirectories.
  417.   Current module utilities can be found in the same locations.
  418.  
  419.   In the Linux source tree for 2.0 and 2.1 kernels, the
  420.   Documentation/Changes file describes the versions of all sorts of
  421.   other system components that are required for that kernel release.
  422.   You may want to check through this and verify that your system is up
  423.   to date, especially if you have updated your kernel.  If you are using
  424.   a 2.1 kernel, be sure that you are using the right combination of
  425.   shared libraries and module tools.
  426.  
  427.   When configuring your kernel, if you plan on using a PCMCIA ethernet
  428.   card, you should turn on networking support but turn off the normal
  429.   Linux network card drivers, including the ``pocket and portable
  430.   adapters''.  The PCMCIA network card drivers are all implemented as
  431.   loadable modules.  Any drivers compiled into your kernel will only
  432.   waste space.
  433.  
  434.   If you want to use SLIP, PPP, or PLIP, you do need to either configure
  435.   your kernel with these enabled, or use the loadable module versions of
  436.   these drivers.  There is an unfortunate deficiency in the kernel
  437.   config process in 1.2.X kernels, in that it is not possible to set
  438.   configuration options (like SLIP compression) for a loadable module,
  439.   so it is probably better to just link SLIP into the kernel if you need
  440.   it.
  441.  
  442.   In order to use a PCMCIA token ring adapter, your kernel should be
  443.   configured with ``Token Ring driver support'' (CONFIG_TR) enabled,
  444.   though you should leave CONFIG_IBMTR off.
  445.  
  446.   If you want to use a PCMCIA IDE adapter, your kernel should be
  447.   configured with CONFIG_BLK_DEV_IDE_PCMCIA enabled, for 1.3.72 through
  448.   2.1.7 kernels.  Older kernels do not support removeable IDE devices;
  449.   newer kernels do not require a special configuration setting.
  450.  
  451.   If you will be using a PCMCIA SCSI adapter, then enable CONFIG_SCSI
  452.   when configuring your kernel.  Also, enable any top level drivers
  453.   (SCSI disk, tape, cdrom, generic) that you expect to use.  All low-
  454.   level drivers for particular host adapters should be disabled, as they
  455.   will just take up space.
  456.  
  457.   If you want to modularize a driver that is needed for a PCMCIA device,
  458.   you must modify /etc/pcmcia/config to specify what modules need to be
  459.   loaded for what card types.  For example, if the serial driver is
  460.   modularized, then the serial device definition should be:
  461.  
  462.        device "serial_cs"
  463.          class "serial" module "misc/serial", "serial_cs"
  464.  
  465.   This package includes an X-based card status utility called cardinfo.
  466.   This utility is based on a freely distributed user interface toolkit
  467.   called the XForms Library.  This library is available as a separate
  468.   package with most Linux distributions.  If you would like to build
  469.   cardinfo, you should install XForms and all the normal X header files
  470.   and libraries before configuring the PCMCIA package.
  471.  
  472.   22..22..  IInnssttaallllaattiioonn
  473.  
  474.   Here is a synopsis of the installation process:
  475.  
  476.   +o  Unpack pcmcia-cs-3.0.?.tar.gz in /usr/src.
  477.  
  478.   +o  Run ``make config'' in the new pcmcia-cs-3.0.? directory.
  479.  
  480.   +o  Run ``make all'', then ``make install''.
  481.  
  482.   +o  Customize the startup script and the option files in /etc/pcmcia
  483.      for your site.
  484.  
  485.   If you plan to install any contributed client drivers not included in
  486.   the core PCMCIA distribution, unpack each of them in the top-level
  487.   directory of the PCMCIA source tree.  Then follow the normal build
  488.   instructions.  The extra drivers will be compiled and installed
  489.   automatically.
  490.  
  491.   Running ``make config'' prompts for a few configuration options, and
  492.   checks out your system to verify that it satisfies all prerequisites
  493.   for installing PCMCIA support.  In most cases, you'll be able to just
  494.   accept all the default configuration options.  Be sure to carefully
  495.   check the output of this command in case there are problems.
  496.  
  497.   If you are compiling the package for installation on another machine,
  498.   specify an alternate target directory when prompted by the configure
  499.   script.  This should be an absolute path.  All filesf will be
  500.   installed relative to this directory.  You will then be able to tar
  501.   this directory tree and copy to your target machine, and unpack
  502.   relative to its root directory to install everything in the proper
  503.   places.
  504.  
  505.   If you are cross compiling on another machine, you may want to specify
  506.   alternate names for the compiler and linker.  This may also be helpful
  507.   on mixed a.out and ELF systems.  The script will also prompt for
  508.   additional compiler flags for debugging.
  509.  
  510.   Some of the support utilities (cardctl and cardinfo) can be compiled
  511.   either in ``safe'' or ``trusting'' forms.  The ``safe'' forms prevent
  512.   non-root users from modifying card configurations.  The ``trusting''
  513.   forms permit ordinary users to issue commands to suspend and resume
  514.   cards, reset cards, and change the current configuration scheme.  The
  515.   configuration script will ask if you want the utilities compiled as
  516.   safe or trusting: the default is to be safe.
  517.  
  518.   There are a few kernel configuration options that affect the PCMCIA
  519.   tools.  The configuration script can deduce these from the running
  520.   kernel (the most common case).  Alternatively, if you are compiling
  521.   for installation on another machine, it can read the configuration
  522.   from a kernel source tree, or each option can be set interactively.
  523.  
  524.   Running ``make all'' followed by ``make install'' will build and then
  525.   install the kernel modules and utility programs.  Kernel modules are
  526.   installed under /lib/modules/<version>/pcmcia.  The cardmgr and
  527.   cardctl programs are installed in /sbin.  If cardinfo is built, it is
  528.   installed in /usr/bin/X11.
  529.  
  530.   Configuration files will be installed in the /etc/pcmcia directory.
  531.   If you are installing over an older version, your old config scripts
  532.   will be backed up before being replaced.  The saved scripts will be
  533.   given extensions like *.~1~, *.~2~, and so on.
  534.  
  535.   If you don't know what kind of host controller your system uses, you
  536.   can use the probe utility in the cardmgr/ subdirectory to determine
  537.   this.  There are two major types: the Databook TCIC-2 type and the
  538.   Intel i82365SL-compatible type.
  539.  
  540.   In a few cases, the probe command will be unable to determine your
  541.   controller type automatically.  If you have a Halikan NBD 486 system,
  542.   it has a TCIC-2 controller at an unusual location: you'll need to edit
  543.   rc.pcmcia to load the tcic module, and also set the PCIC_OPTS
  544.   parameter to ``tcic_base=0x02c0''.
  545.  
  546.   On some systems using Cirrus controllers, including the NEC Versa M,
  547.   the BIOS puts the controller in a special suspended state at system
  548.   startup time.  On these systems, the probe command will fail to find
  549.   any known host controller.  If this happens, edit rc.pcmcia and set
  550.   PCIC to i82365, and PCIC_OPTS to ``wakeup=1''.
  551.  
  552.   22..33..  SSttaarrttuupp ooppttiioonnss
  553.  
  554.   The PCMCIA startup script recognizes several groups of startup
  555.   options, set via environment variables.  Multiple options should be
  556.   separated by spaces and enclosed in quotes.  Placement of startup
  557.   options depends on the Linux distribution used.  They may be placed
  558.   directly in the startup script, or they may be kept in a separate
  559.   option file.  See the ``Notes about specific Linux distributions'' for
  560.   specifics.  The following variables can be set:
  561.  
  562.      PCMCIA
  563.         This variable specifies whether PCMCIA support should be started
  564.         up, or not.  If it is set to anything other than ``yes'', then
  565.         the startup script will be disabled.
  566.  
  567.      PCIC
  568.         This identifies the PC Card Interface Controller driver module.
  569.         There are two options: ``tcic'' or ``i82365''.  Virtually all
  570.         current controllers are in the ``i82365'' group.  This is the
  571.         only mandatory option setting.
  572.      PCIC_OPTS
  573.         This specifies options for the PCIC module.  Some host
  574.         controllers have optional features that may or may not be
  575.         implemented in a particular system.  In some cases, it is
  576.         impossible for the socket driver to detect if these features are
  577.         implemented.  See the corresponding man page for a complete
  578.         description of the available options.
  579.  
  580.      CORE_OPTS
  581.         This specifies options for the pcmcia_core module, which
  582.         implements the core PC Card driver services.  See ``man
  583.         pcmcia_core'' for more information.
  584.  
  585.      CARDMGR_OPTS
  586.         This specifies options to be passed to the cardmgr daemon.  See
  587.         ``man cardmgr'' for more information.
  588.  
  589.      SCHEME
  590.         If set, then the PC Card configuration scheme will be
  591.         initialized to this at driver startup time.  See the ``Overview
  592.         of the PCMCIA configuration scripts'' for a discussion of
  593.         schemes.
  594.  
  595.   The low level socket drivers, tcic and i82365, have numerous bus
  596.   timing parameters that may need to be adjusted for systems with
  597.   unusual bus clocking.  Symptoms of timing problems include card
  598.   recognition problems, lock-ups under heavy loads, high error rates, or
  599.   poor device performance.  Check the corresponding man pages for more
  600.   details, but here is a brief summary:
  601.  
  602.   +o  Cirrus controllers have numerous configurable timing parameters.
  603.      The most important seems to be the cmd_time flag, which determines
  604.      the length of PCMCIA bus cycles.  Fast 486 systems (i.e., DX4-100)
  605.      seem to often benefit from increasing this from 6 (the default) to
  606.      12 or 16.
  607.  
  608.   +o  The Cirrus PD6729 PCI controller has the fast_pci flag, which
  609.      should be set if the PCI bus speed is greater than 25 MHz.
  610.  
  611.   +o  For Vadem VG-468 controllers and Databook TCIC-2 controllers, the
  612.      async_clock flag changes the relative clocking of PCMCIA bus and
  613.      host bus cycles.  Setting this flag adds extra wait states to some
  614.      operations.  However, I have yet to hear of a laptop that needs
  615.      this.
  616.  
  617.   +o  The pcmcia_core module has the cis_speed parameter for changing the
  618.      memory speed used for accessing a card's Card Information Structure
  619.      (CIS).  On some systems with fast bus clocks, increasing this
  620.      parameter (i.e., slowing down card accesses) may be beneficial for
  621.      card recognition problems.
  622.  
  623.   +o  This is not a timing issue, but if you have more than one ISA-to-
  624.      PCMCIA controller in your system or extra sockets in a docking
  625.      station, the i82365 module should be loaded with the extra_sockets
  626.      parameter set to 1.  This should not be necessary for detection of
  627.      PCI-to-PCMCIA or PCI-to-CardBus bridges.
  628.  
  629.   Here are some timing settings for specific systems:
  630.  
  631.   +o  On the ARM Pentium-90 or Midwest Micro Soundbook Plus, use
  632.      ``freq_bypass=1 cmd_time=8''.
  633.  
  634.   +o  On a Midwest Micro Soundbook Elite, use ``cmd_time=12''.
  635.  
  636.   +o  On a Gateway Liberty, try ``cmd_time=16''.
  637.  
  638.   22..44..  SSyysstteemm rreessoouurrccee sseettttiinnggss
  639.  
  640.   Card Services should automatically avoid allocating IO ports and
  641.   interrupts already in use by other standard devices.  It will also
  642.   attempt to detect conflicts with unknown devices, but this is not
  643.   completely reliable.  In some cases, you may need to explicitly
  644.   exclude resources for a device in /etc/pcmcia/config.opts.
  645.  
  646.   Here are some resource settings for specific laptop types.  View this
  647.   list with suspicion: it may give useful hints for solving problems,
  648.   but it is inevitably out of date and certainly contains mistakes.
  649.   Corrections and additions are welcome.
  650.  
  651.   +o  On the AMS SoundPro, exclude irq 10.
  652.  
  653.   +o  On some AMS TravelPro 5300 models, use memory 0xc8000-0xcffff.
  654.  
  655.   +o  On the BMX 486DX2-66, exclude irq 5, irq 9.
  656.  
  657.   +o  On the Chicony NB5, use memory 0xda000-0xdffff.
  658.  
  659.   +o  On the Compaq Presario 1020, exclude port 0x2f8-0x2ff, irq 3, irq
  660.      5.
  661.  
  662.   +o  On the HP Omnibook 4000C, exclude port 0x300-0x30f.
  663.  
  664.   +o  On the IBM ThinkPad 380, and maybe the 385 and 600 series, exclude
  665.      port 0x230-0x233, and irq 5.
  666.  
  667.   +o  On the Micron Millenia Transport, exclude irq 5, irq 9.
  668.  
  669.   +o  On the NEC Versa M, exclude irq 9, port 0x2e0-2ff.
  670.  
  671.   +o  On the NEC Versa P/75, exclude irq 5, irq 9.
  672.  
  673.   +o  On the NEC Versa S, exclude irq 9, irq 12.
  674.  
  675.   +o  On the NEC Versa 6000 series, exclude port 0x2f8-0x33f, irq 9, irq
  676.      10.
  677.  
  678.   +o  On the ProStar 9200, Altima Virage, and Acquiline Hurricane
  679.      DX4-100, exclude irq 5, port 0x330-0x35f.  Maybe use memory
  680.      0xd8000-0xdffff.
  681.  
  682.   +o  On the Siemens Nixdorf SIMATIC PG 720C, use memory 0xc0000-0xcffff,
  683.      port 0x300-0x3bf.
  684.  
  685.   +o  On the TI TravelMate 5000, use memory 0xd4000-0xdffff.
  686.  
  687.   +o  On the Toshiba T4900 CT, exclude irq 5, port 0x2e0-0x2e8, port
  688.      0x330-0x338.
  689.  
  690.   +o  On the Twinhead 5100, HP 4000, Sharp PC-8700 and PC-8900, exclude
  691.      irq 9 (sound), irq 12.
  692.  
  693.   +o  On an MPC 800 Series, exclude irq 5, port 0x300-0x30f for the CD-
  694.      ROM.
  695.  
  696.   22..55..  NNootteess aabboouutt ssppeecciiffiicc LLiinnuuxx ddiissttrriibbuuttiioonnss
  697.  
  698.   This section is incomplete.  Corrections and additions are welcome.
  699.  
  700.   22..55..11..  DDeebbiiaann
  701.  
  702.   Debian uses a System V boot script arrangement.  The PCMCIA startup
  703.   script is installed as /etc/init.d/pcmcia, and startup options are
  704.   specified in /etc/pcmcia.conf.  Debian's syslog configuration will
  705.   place kernel messages in /var/log/messages and cardmgr messages in
  706.   /var/log/daemon.log.
  707.  
  708.   Debian distributes the PCMCIA system in two packages: the ``pcmcia-
  709.   cs'' package contains cardmgr and other tools, man pages, and
  710.   configuration scripts; and the ``pcmcia-modules'' package contains the
  711.   kernel driver modules.
  712.  
  713.   22..55..22..  RReedd HHaatt,, aanndd CCaallddeerraa OOppeenn DDeesskkttoopp
  714.  
  715.   These distributions use a System V boot script organization.  The
  716.   PCMCIA startup script is installed as /etc/rc.d/init.d/pcmcia, and
  717.   boot options are kept in /etc/sysconfig/pcmcia.  Beware that
  718.   installing the Red Hat package may install a default boot option file
  719.   that has PCMCIA disabled.  To enable PCMCIA, the ``PCMCIA'' variable
  720.   should be set to ``yes''.  Red Hat's default syslogd configuration
  721.   will record all interesting messages in /var/log/messages.
  722.  
  723.   Red Hat's PCMCIA package contains a replacement for the network setup
  724.   script, /etc/pcmcia/network, which meshes with the Red Hat network
  725.   control panel.  This is convenient for the case where just one network
  726.   adapter is used, with one set of network parameters, but does not have
  727.   the full flexibility of the regular PCMCIA network script.  Compiling
  728.   and installing a clean PCMCIA source distribution will overwrite the
  729.   network script, breaking the link to the network control panel.  If
  730.   you prefer the Red Hat script, either use only Red Hat RPM's, or
  731.   create /etc/pcmcia/network.opts with the following contents:
  732.  
  733.        if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ] ; then
  734.            start_fn () {
  735.                /sbin/ifup $1
  736.            }
  737.            stop_fn () {
  738.                /sbin/ifdown $1
  739.            }
  740.        fi
  741.  
  742.   Red Hat bundles their slightly modified PCMCIA source distribution in
  743.   their kernel SRPM, rather than as a separate package.
  744.  
  745.   22..55..33..  SSllaacckkwwaarree
  746.  
  747.   Slackware uses a BSD boot script arrangement.  The PCMCIA startup
  748.   script is installed as /etc/rc.d/rc.pcmcia, and boot options are
  749.   specified in rc.pcmcia itself.  The PCMCIA startup script is invoked
  750.   from /etc/rc.d/rc.M.
  751.  
  752.   22..55..44..  SSuuSSEE
  753.  
  754.   SuSE uses a System V init script arrangement, with init scripts stored
  755.   under /sbin/init.d.  The PCMCIA startup script is installed as
  756.   /sbin/init.d/pcmcia, and startup options are kept in /etc/rc.config.
  757.  
  758.   33..  RReessoollvviinngg iinnssttaallllaattiioonn aanndd ccoonnffiigguurraattiioonn pprroobblleemmss
  759.  
  760.   This section describes some of the most common failure modes for the
  761.   PCMCIA subsystem.  Try to match your symptoms against the examples.
  762.   This section only describes general failures that are not specific to
  763.   a particular client driver or type of card.
  764.  
  765.   Before trying to diagnose a problem, you have to know where your
  766.   system log is kept (see ``Notes about specific Linux distributions'').
  767.   You should also be familiar with basic diagnostic tools like dmesg and
  768.   lsmod.  Also, be aware that most driver components (including all the
  769.   kernel modules) have their own individual man pages.
  770.  
  771.   It is nearly impossible to debug driver problems encountered when
  772.   attempting to install Linux via a PCMCIA device.  Even if you can
  773.   identify the problem based on its symptoms, installation disks are
  774.   difficult to modify, especially without access to a running Linux
  775.   system.  Customization of installation disks is completely dependent
  776.   on the choice of Linux distribution, and is beyond the scope of this
  777.   document.  In general, the best course of action is to install Linux
  778.   using some other means, obtain the latest drivers, and then debug the
  779.   problem if it persists.
  780.  
  781.   33..11..  BBaassee PPCCMMCCIIAA kkeerrnneell mmoodduulleess ddoo nnoott llooaadd
  782.  
  783.   Symptoms:
  784.  
  785.   +o  Kernel version mismatch errors are reported when the PCMCIA startup
  786.      script runs.
  787.  
  788.   +o  After startup, lsmod does not show any PCMCIA modules.
  789.  
  790.   +o  cardmgr reports ``no pcmcia driver in /proc/devices'' in the system
  791.      log.
  792.  
  793.   Kernel modules contain version information that is checked against the
  794.   current kernel when a module is loaded.  The type of checking depends
  795.   on the setting of the CONFIG_MODVERSIONS kernel option.  If this is
  796.   false, then the kernel version number is compiled into each module,
  797.   and insmod checks this for a match with the running kernel.  If
  798.   CONFIG_MODVERSIONS is true, then each symbol exported by the kernel is
  799.   given a sort of checksum.  These codes are all compared against the
  800.   corresponding codes compiled into a module.  The intent was for this
  801.   to make modules less version-dependent, because the checksums would
  802.   only change if a kernel interface changed, and would generally stay
  803.   the same across minor kernel updates.  In practice, the checksums have
  804.   turned out to be even more restrictive, because many kernel interfaces
  805.   depend on compile-time kernel option settings.  Also, the checksums
  806.   turned out to be an excessively pessimistic judge of compatibility.
  807.  
  808.   The practical upshot of this is that kernel modules are closely tied
  809.   to both the kernel version, and the setting of many kernel
  810.   configuration options.  Generally, a set of modules compiled for one
  811.   2.0.31 kernel will not load against some other 2.0.31 kernel unless
  812.   special care is taken to ensure that the two were built with similar
  813.   configurations.  This makes distribution of precompiled kernel modules
  814.   a tricky business.
  815.  
  816.   You have several options:
  817.  
  818.   +o  If you obtained precompiled drivers as part of a Linux
  819.      distribution, verify that you are using an unmodified kernel as
  820.      supplied with that distribution.  If you intend to use precompiled
  821.      modules, you generally must stick with the corresponding kernel.
  822.  
  823.   +o  If you have reconfigured or upgraded your kernel, you will probably
  824.      need to compile and install the PCMCIA package from scratch.  This
  825.      is easily done if you already have the kernel source tree
  826.      installed.  See ``Compilation and installation'' for detailed
  827.      instructions.
  828.  
  829.   +o  In some cases, incompatibilities in other system components can
  830.      prevent correct loading of kernel modules.  If you have upgraded
  831.      your own kernel, pay attention to the ``minimal requirements'' for
  832.      module utilities and binutils listed in the Documentation/Changes
  833.      file in the kernel source code tree.
  834.  
  835.   33..22..  SSoommee cclliieenntt ddrriivveerr mmoodduulleess ddoo nnoott llooaadd
  836.  
  837.   Symptoms:
  838.  
  839.   +o  The base modules (pcmcia_core, ds, i82365) load correctly.
  840.  
  841.   +o  Inserting a card gives a high beep + low beep pattern.
  842.  
  843.   +o  cardmgr reports version mismatch errors in the system log.
  844.  
  845.   Some of the driver modules require kernel services that may or may not
  846.   be present, depending on kernel configuration.  For instance, the SCSI
  847.   card drivers require that the kernel be configured with SCSI support,
  848.   and the network drivers require a networking kernel.  If a kernel
  849.   lacks a necessary feature, insmod may report undefined symbols and
  850.   refuse to load a particular module. Note that insmod error messages do
  851.   not distinguish between version mismatch errors and missing symbol
  852.   errors.
  853.  
  854.   Specifically:
  855.  
  856.   +o  The serial client driver serial_cs requires the kernel serial
  857.      driver to be enabled with CONFIG_SERIAL.  This driver may be built
  858.      as a module.
  859.  
  860.   +o  The SCSI client drivers require that CONFIG_SCSI be enabled, along
  861.      with the appropriate top level driver options (CONFIG_BLK_DEV_SD,
  862.      CONFIG_BLK_DEV_SR, etc for 2.1 kernels).  These may be built as
  863.      modules.
  864.  
  865.   +o  The network client drivers require that CONFIG_INET is enabled.
  866.      Kernel networking support cannot be compiled as a module.
  867.  
  868.   +o  The token-ring client requires that the kernel be compiled with
  869.      CONFIG_TR enabled.
  870.  
  871.   There are two ways to proceed:
  872.  
  873.   +o  Rebuild your kernel with the necessary features enabled.
  874.  
  875.   +o  If the features have been compiled as modules, then modify
  876.      /etc/pcmcia/config to preload these modules.
  877.  
  878.   The /etc/pcmcia/config file can specify that additional modules need
  879.   to be loaded for a particular client.  For example, for the serial
  880.   driver, one would use:
  881.  
  882.        device "serial_cs"
  883.          class "serial" module "misc/serial", "serial_cs"
  884.  
  885.   Module paths are specified relative to the top-level module directory
  886.   for the current kernel version; if no relative path is given, then the
  887.   path defaults to the pcmcia subdirectory.
  888.  
  889.   33..33..  IInntteerrrruupptt ssccaann ffaaiilluurreess
  890.  
  891.   Symptoms:
  892.  
  893.   +o  The system locks up when the PCMCIA drivers are loaded, even with
  894.      no cards present.
  895.  
  896.   +o  The system log shows a successful host controller probe just before
  897.      the lock-up, but does not show interrupt probe results.
  898.  
  899.   After identifying the host controller type, the socket driver probes
  900.   for free interrupts.  The probe involves programming the controller
  901.   for each apparently free interrupt, then generating a ``soft''
  902.   interrupt, to see if the interrupt can be detected correctly.  In some
  903.   cases, probing a particular interrupt can interfere with another
  904.   system device.
  905.  
  906.   The reason for the probe is to identify interrupts which appear to be
  907.   free (i.e., are not reserved by any other Linux device driver), yet
  908.   are either not physically wired to the host controller, or are
  909.   connected to another device that does not have a driver.
  910.  
  911.   In the system log, a successful probe might look like:
  912.  
  913.        Intel PCIC probe:
  914.          TI 1130 CardBus at mem 0x10211000, 2 sockets
  915.          ...
  916.          ISA irqs (scanned) = 5,7,9,10 status change on irq 10
  917.  
  918.   There are two ways to proceed:
  919.  
  920.   +o  The interrupt probe can be restricted to a list of interrupts using
  921.      the irq_list parameter for the socket drivers.  For example,
  922.      ``irq_list=5,9,10'' would limit the scan to three interrupts.  All
  923.      PCMCIA devices will be restricted to using these interrupts
  924.      (assuming they pass the probe).  You may need to use trial and
  925.      error to find out which interrupts can be safely probed.
  926.  
  927.   +o  The interrupt probe can be disabled entirely by loading the socket
  928.      driver with the ``do_scan=0'' option.  In this case, a default
  929.      interrupt list will be used, which avoids interrupts already
  930.      allocated for other devices.
  931.  
  932.   In either case, the probe options can be specified using the PCIC_OPTS
  933.   definition in the PCMCIA startup script, for example:
  934.  
  935.        PCIC_OPTS="irq_list=5,9,10"
  936.  
  937.   33..44..  IIOO ppoorrtt ssccaann ffaaiilluurreess
  938.  
  939.   Symptoms:
  940.  
  941.   +o  The system locks up when cardmgr is first started, even with no
  942.      cards present.
  943.  
  944.   +o  The system log shows a successful host controller probe, including
  945.      interrupt probe results, but does not show IO probe results.
  946.  
  947.   +o  In some cases, the IO probe will succeed, but report large numbers
  948.      of random exclusions.
  949.  
  950.   When cardmgr processes IO port ranges listed in
  951.   /etc/pcmcia/config.opts, the kernel probes these ranges to detect
  952.   latent devices that occupy IO space but are not associated with a
  953.   Linux driver.  The probe is read-only, but in rare cases, reading from
  954.   a device may interfere with an important system function, resulting in
  955.   a lock-up.
  956.  
  957.   Your system user's guide may include a map of system devices, showing
  958.   their IO and memory ranges.  These can be explicitly excluded in
  959.   config.opts.
  960.  
  961.   Alternatively, if the probe is unreliable on your system, it can be
  962.   disabled by setting CORE_OPTS to ``probe_io=0''.  In this case, you
  963.   should be very careful to specify only genuinely available ranges of
  964.   ports in config.opts, instead of using the default settings.
  965.  
  966.   33..55..  MMeemmoorryy pprroobbee ffaaiilluurreess
  967.  
  968.   Symptoms:
  969.  
  970.   +o  The core drivers load correctly when no cards are present, with no
  971.      errors in the system log.
  972.  
  973.   +o  The system freezes and/or reboots as soon as any card is inserted,
  974.      before any beeps are heard.
  975.  
  976.   Or alternately:
  977.  
  978.   +o  All card insertions generate a high beep followed by a low beep.
  979.  
  980.   +o  All cards are identified as ``anonymous memory cards''.
  981.  
  982.   +o  The system log reports that various memory ranges have been
  983.      excluded.
  984.  
  985.   The core modules perform a memory scan at the time of first 16-bit
  986.   card insertion.  This scan can potentially interfere with other memory
  987.   mapped devices.  Also, pre-3.0.0 driver packages perform a more
  988.   aggressive scan than more recent drivers.  The memory window is
  989.   defined in /etc/pcmcia/config.opts.  The default window is large, so
  990.   it may help to restrict the scan to a narrower range.  Reasonable
  991.   ranges to try include 0xd0000-0xdffff, 0xc0000-0xcffff,
  992.   0xc8000-0xcffff, or 0xd8000-0xdffff.
  993.  
  994.   If you have DOS or Windows PCMCIA drivers, you may be able to deduce
  995.   what memory region those drivers use.  Note that DOS memory addresses
  996.   are often specified in ``segment'' form, which leaves off the final
  997.   hex digit (so an absolute address of 0xd0000 might be given as
  998.   0xd000).  Be sure to add the extra digit back when making changes to
  999.   config.opts.
  1000.  
  1001.   In unusual cases, a memory probe failure can indicate a timing
  1002.   register setup problem with the host controller.  See the ``Startup
  1003.   options'' section for information about dealing with common timing
  1004.   problems.
  1005.  
  1006.   +o  cs: warning: no high memory space available!
  1007.  
  1008.   CardBus bridges can allocate memory windows outside of the 640KB-1MB
  1009.   ``memory hole'' in the ISA bus architecture.  It is generally a good
  1010.   idea to configure CardBus bridges to use high memory windows, because
  1011.   these are unlikely to conflict with other devices.  Also, CardBus
  1012.   cards may require large memory windows, which may be difficult or
  1013.   impossible to fit into low memory.  Card Services will preferentially
  1014.   allocate windows in high memory for CardBus bridges, if both low and
  1015.   high memory windows are defined in config.opts.  The default
  1016.   config.opts now includes a high memory window of
  1017.   0xa0000000-0xa0ffffff.  If you have a CardBus bridge and have upgraded
  1018.   from an older PCMCIA driver release, add this memory window if it is
  1019.   not already defined.
  1020.  
  1021.   33..66..  FFaaiilluurree ttoo ddeetteecctt ccaarrdd iinnsseerrttiioonnss aanndd rreemmoovvaallss
  1022.  
  1023.   Symptoms:
  1024.  
  1025.   +o  Cards are detected and configured properly if present at boot time.
  1026.  
  1027.   +o  The drivers do not respond to insertion and removal events, either
  1028.      by recording events in the system log, or by beeping.
  1029.  
  1030.   In most cases, the socket driver (i82365 or tcic) will automatically
  1031.   probe and select an appropriate interrupt to signal card status
  1032.   changes.  The automatic interrupt probe doesn't work on some Intel-
  1033.   compatible controllers, including Cirrus chips and the chips used in
  1034.   some IBM ThinkPads.  If a device is inactive at probe time, its
  1035.   interrupt may also appear to be available.  In these cases, the socket
  1036.   driver may pick an interrupt that is used by another device.
  1037.  
  1038.   With the i82365 and tcic drivers, the irq_list option can be used to
  1039.   limit the interrupts that will be tested.  This list limits the set of
  1040.   interrupts that can be used by PCMCIA cards as well as for monitoring
  1041.   card status changes.  The cs_irq option can also be used to explicitly
  1042.   set the interrupt to be used for monitoring card status changes.
  1043.  
  1044.   If you can't find an interrupt number that works, there is also a
  1045.   polled status mode: both i82365 and tcic will accept a
  1046.   poll_interval=100 option, to poll for card status changes once per
  1047.   second.  This option should also be used if your system has a shortage
  1048.   of interrupts available for use by PCMCIA cards.  Especially for
  1049.   systems with more than one host controller, there is little point in
  1050.   dedicating interrupts for monitoring card status changes.
  1051.  
  1052.   All these options should be set in the PCIC_OPTS= line in either
  1053.   /etc/rc.d/rc.pcmcia or /etc/sysconfig/pcmcia, depending on your site
  1054.   setup.
  1055.  
  1056.   33..77..  SSyysstteemm rreessoouurrccee ssttaarrvvaattiioonn
  1057.  
  1058.   Symptoms:
  1059.  
  1060.   +o  When a card is inserted, it is identified correctly but cannot be
  1061.      configured (high/low beep pattern).
  1062.  
  1063.   +o  One of the following messages will appear in the system log:
  1064.  
  1065.        RequestIO: Resource in use
  1066.        RequestIRQ: Resource in use
  1067.        RequestWindow: Resource in use
  1068.        GetNextTuple: No more items
  1069.        could not allocate nn IO ports for CardBus socket n
  1070.        could not allocate nnK memory for CardBus socket n
  1071.        could not allocate interrupt for CardBus socket n
  1072.  
  1073.   Interrupt starvation often indicates a problem with the interrupt
  1074.   probe (see ``Interrupt probe failures'').  In some cases, the probe
  1075.   will seem to work, but only report one or two available interrupts.
  1076.   Check your system log to see if the scan results look sensible.
  1077.   Disabling the probe and selecting interrupts manually should help.
  1078.  
  1079.   If the interrupt probe is not working properly, the socket driver may
  1080.   allocate an interrupt for monitoring card insertions, even when
  1081.   interrupts are too scarce for this to be a good idea.  In that case,
  1082.   you can switch the controller to polled mode by setting PCIC_OPTS to
  1083.   ``poll_interval=100'.  Or, if you have a CardBus controller, try
  1084.   ``pci_csc=1'', which selects a PCI interrupt (if available) for card
  1085.   status changes.
  1086.  
  1087.   IO port starvation is fairly uncommon, but sometimes happens with
  1088.   cards that require large, contiguous, aligned regions of IO port
  1089.   space, or that only recognize a few specific IO port positions.  The
  1090.   default IO port ranges in /etc/pcmcia/config.opts are normally
  1091.   sufficient, but may be extended.  In rare cases, starvation may
  1092.   indicate that the IO port probe failed (see ``IO port scan
  1093.   failures'').
  1094.  
  1095.   Memory starvation is also uncommon with the default memory window
  1096.   settings in config.opts.  CardBus cards may require larger memory
  1097.   regions than typical 16-bit cards.  Since CardBus memory windows can
  1098.   be mapped anywhere in the host's PCI address space (rather than just
  1099.   in the 640K-1MB ``hole'' in PC systems), it is helpful to specify
  1100.   large memory windows in high memory, such as 0xa0000000-0xa0ffffff.
  1101.  
  1102.   33..88..  RReessoouurrccee ccoonnfflliicctt bbeettwweeeenn ttwwoo ccaarrddss
  1103.  
  1104.   Symptoms:
  1105.  
  1106.   +o  Two cards each work fine when used separately.
  1107.  
  1108.   +o  When both cards are inserted, only one works.
  1109.  
  1110.   This usually indicates a resource conflict with a system device that
  1111.   Linux does not know about.  PCMCIA devices are dynamically configured,
  1112.   so, for example, interrupts are allocated as needed, rather than
  1113.   specifically assigned to particular cards or sockets.  Given a list of
  1114.   resources that appear to be available, cards are assigned resources in
  1115.   the order they are configured.  In this case, the card configured last
  1116.   is being assigned a resource that in fact is not free.
  1117.  
  1118.   Check the system log to see what resources are used by the non-working
  1119.   card.  Exclude these in /etc/pcmcia/config.opts, and restart the
  1120.   cardmgr daemon to reload the resource database.
  1121.  
  1122.   33..99..  DDeevviiccee ccoonnffiigguurraattiioonn ddooeess nnoott ccoommpplleettee
  1123.  
  1124.   Symptoms:
  1125.  
  1126.   +o  When a card is inserted, exactly one high beep is heard.
  1127.  
  1128.   +o  Subsequent card insertions and removals may be ignored.
  1129.  
  1130.   This indicates that the card was identified successfully, however,
  1131.   cardmgr has been unable to complete the configuration process for some
  1132.   reason.  The most likely reason is that a step in the card setup
  1133.   script has blocked.  A good example would be the network script
  1134.   blocking if a network card is inserted with no actual network hookup
  1135.   present.
  1136.  
  1137.   To pinpoint the problem, you can manually run a setup script to see
  1138.   where it is blocking.  The scripts are in the /etc/pcmcia directory.
  1139.   They take two parameters: a device name, and an action.  The cardmgr
  1140.   daemon records the configuration commands in the system log.  For
  1141.   example, if the system log shows that the command ``./network start
  1142.   eth0'' was the last command executed by cardmgr, the following command
  1143.   would trace the script:
  1144.  
  1145.        sh -x /etc/pcmcia/network start eth0
  1146.  
  1147.   44..  UUssaaggee aanndd ffeeaattuurreess
  1148.  
  1149.   44..11..  TToooollss ffoorr ccoonnffiigguurriinngg aanndd mmoonniittoorriinngg PPCCMMCCIIAA ddeevviicceess
  1150.  
  1151.   If the modules are all loaded correctly, the output of the lsmod
  1152.   command should look like the following, when no cards are inserted:
  1153.  
  1154.        Module                  Size  Used by
  1155.        ds                      5640   2
  1156.        i82365                 15452   2
  1157.        pcmcia_core            30012   3  [ds i82365]
  1158.  
  1159.   The system log should also include output from the socket driver
  1160.   describing the host controller(s) found and the number of sockets
  1161.   detected.
  1162.  
  1163.   44..11..11..  TThhee ccaarrddmmggrr ccoonnffiigguurraattiioonn ddaaeemmoonn
  1164.  
  1165.   The cardmgr daemon is responsible for monitoring PCMCIA sockets,
  1166.   loading client drivers when needed, and running user-level scripts in
  1167.   response to card insertions and removals.  It records its actions in
  1168.   the system log, but also uses beeps to signal card status changes.
  1169.   The tones of the beeps indicate success or failure of particular
  1170.   configuration steps.  Two high beeps indicate that a card was
  1171.   identified and configured successfully.  A high beep followed by a low
  1172.   beep indicates that a card was identified, but could not be configured
  1173.   for some reason.  One low beep indicates that a card could not be
  1174.   identified.
  1175.  
  1176.   Cardmgr records device information for each socket in /var/run/stab.
  1177.   Here is a sample /var/run/stab listing:
  1178.  
  1179.        Socket 0: Adaptec APA-1460 SlimSCSI
  1180.        0       scsi    aha152x_cs      0       sda     8       0
  1181.        0       scsi    aha152x_cs      1       scd0    11      0
  1182.        Socket 1: Serial or Modem Card
  1183.        1       serial  serial_cs       0       ttyS1   5       65
  1184.  
  1185.   For the lines describing devices, the first field is the socket, the
  1186.   second is the device class, the third is the driver name, the fourth
  1187.   is used to number multiple devices associated with the same driver,
  1188.   the fifth is the device name, and the final two fields are the major
  1189.   and minor device numbers for this device (if applicable).
  1190.  
  1191.   The cardmgr daemon configures cards based on a database of known card
  1192.   types kept in /etc/pcmcia/config.  This file describes the various
  1193.   client drivers, then describes how to identify various cards, and
  1194.   which driver(s) belong with which cards.  The format of this file is
  1195.   described in the pcmcia(5) man page.
  1196.  
  1197.   44..11..22..  TThhee ccaarrddccttll aanndd ccaarrddiinnffoo uuttiilliittiieess
  1198.  
  1199.   The cardctl command can be used to check the status of a socket, or to
  1200.   see how it is configured.  It can also be used to alter the
  1201.   configuration status of a card.  Here is an example of the output of
  1202.   the ``cardctl config'' command:
  1203.  
  1204.        Socket 0:
  1205.          not configured
  1206.        Socket 1:
  1207.          Vcc = 5.0, Vpp1 = 0.0, Vpp2 = 0.0
  1208.          Card type is memory and I/O
  1209.          IRQ 3 is dynamic shared, level mode, enabled
  1210.          Speaker output is enabled
  1211.          Function 0:
  1212.            Config register base = 0x0800
  1213.              Option = 0x63, status = 0x08
  1214.            I/O window 1: 0x0280 to 0x02bf, auto sized
  1215.            I/O window 2: 0x02f8 to 0x02ff, 8 bit
  1216.  
  1217.   Or ``cardctl ident'', to get card identification information:
  1218.  
  1219.        Socket 0:
  1220.          no product info available
  1221.        Socket 1:
  1222.          product info: "LINKSYS", "PCMLM336", "A", "0040052D6400"
  1223.          manfid: 0x0143, 0xc0ab
  1224.          function: 0 (multifunction)
  1225.  
  1226.   The ``cardctl suspend'' and ``cardctl resume'' commands can be used to
  1227.   shut down a card without unloading its associated drivers.  The
  1228.   ``cardctl reset'' command attempts to reset and reconfigure a card.
  1229.   ``cardctl insert'' and ``cardctl eject'' mimic the actions performed
  1230.   when a card is physically inserted or ejected, including loading or
  1231.   unloading drivers, and configuring or shutting down devices.
  1232.  
  1233.   If you are running X, the cardinfo utility produces a graphical
  1234.   display showing the current status of all PCMCIA sockets, similar in
  1235.   content to ``cardctl config''.  It also provides a graphical interface
  1236.   to most other cardctl functions.
  1237.  
  1238.   44..11..33..  IInnsseerrttiinngg aanndd eejjeeccttiinngg ccaarrddss
  1239.  
  1240.   In theory, you can insert and remove PCMCIA cards at any time.
  1241.   However, it is a good idea not to eject a card that is currently being
  1242.   used by an application program.  Kernels older than 1.1.77 would often
  1243.   lock up when serial/modem cards were ejected, but this should be fixed
  1244.   now.
  1245.  
  1246.   44..11..44..  CCaarrdd SSeerrvviicceess aanndd AAddvvaanncceedd PPoowweerr MMaannaaggeemmeenntt
  1247.  
  1248.   Card Services can be compiled with support for APM (Advanced Power
  1249.   Management) if you've installed this package on your system.  APM is
  1250.   incorporated into 1.3.46 and later kernels.  It is currently being
  1251.   maintained by Rick Faith (faith@cs.unc.edu), and APM tools can be
  1252.   obtained from <ftp://ftp.cs.unc.edu/pub/users/faith/linux>.  The
  1253.   PCMCIA modules will automatically be configured for APM if a
  1254.   compatible version is detected on your system.
  1255.  
  1256.   Without resorting to APM, you can do ``cardctl suspend'' before
  1257.   suspending your laptop, and ``cardctl resume'' after resuming, to
  1258.   properly shut down and restart your PCMCIA cards.  This will not work
  1259.   with a modem that is in use, because the serial driver isn't able to
  1260.   save and restore the modem operating parameters.
  1261.  
  1262.   APM seems to be unstable on some systems.  If you experience trouble
  1263.   with APM and PCMCIA on your system, try to narrow down the problem to
  1264.   one package or the other before reporting a bug.
  1265.  
  1266.   Some drivers, notably the PCMCIA SCSI drivers, cannot recover from a
  1267.   suspend/resume cycle.  When using a PCMCIA SCSI card, always use
  1268.   ``cardctl eject'' prior to suspending the system.
  1269.  
  1270.   44..11..55..  SShhuuttttiinngg ddoowwnn tthhee PPCCMMCCIIAA ssyysstteemm
  1271.  
  1272.   To unload the entire PCMCIA package, invoke rc.pcmcia with:
  1273.  
  1274.        /etc/rc.d/rc.pcmcia stop
  1275.  
  1276.   This script will take several seconds to run, to give all client
  1277.   drivers time to shut down gracefully.  If a device is currently in
  1278.   use, the shutdown will be incomplete, and some kernel modules may not
  1279.   be unloaded.  To avoid this, use ``cardctl eject'' to shut down all
  1280.   sockets before invoking rc.pcmcia.  The exit status of the cardctl
  1281.   command will indicate if any sockets could not be shut down.
  1282.  
  1283.   44..22..  OOvveerrvviieeww ooff tthhee PPCCMMCCIIAA ccoonnffiigguurraattiioonn ssccrriippttss
  1284.  
  1285.   Each PCMCIA device has an associated ``class'' that describes how it
  1286.   should be configured and managed.  Classes are associated with device
  1287.   drivers in /etc/pcmcia/config.  There are currently five IO device
  1288.   classes (network, SCSI, cdrom, fixed disk, and serial) and two memory
  1289.   device classes (memory and FTL).  For each class, there are two
  1290.   scripts in /etc/pcmcia: a main configuration script (i.e.,
  1291.   /etc/pcmcia/scsi for SCSI devices), and an options script (i.e.,
  1292.   /etc/pcmcia/scsi.opts).  The main script for a device will be invoked
  1293.   to configure that device when a card is inserted, and to shut down the
  1294.   device when the card is removed.  For cards with several associated
  1295.   devices, the script will be invoked for each device.
  1296.  
  1297.   The config scripts start by extracting some information about a device
  1298.   from /var/run/stab.  Each script constructs a ``device address'', that
  1299.   uniquely describes the device it has been asked to configure, in the
  1300.   ADDRESS shell variable.  This is passed to the *.opts script, which
  1301.   should return information about how a device at this address should be
  1302.   configured.  For some devices, the device address is just the socket
  1303.   number.  For others, it includes extra information that may be useful
  1304.   in deciding how to configure the device.  For example, network devices
  1305.   pass their hardware ethernet address as part of the device address, so
  1306.   the network.opts script could use this to select from several
  1307.   different configurations.
  1308.  
  1309.   The first part of all device addresses is the current PCMCIA
  1310.   ``scheme''.  This parameter is used to support multiple sets of device
  1311.   configurations based on a single external user-specified variable.
  1312.   One use of schemes would be to have a ``home'' scheme, and a ``work''
  1313.   scheme, which would include different sets of network configuration
  1314.   parameters.  The current scheme is selected using the ``cardctl
  1315.   scheme'' command.  The default if no scheme is set is ``default''.
  1316.  
  1317.   As a general rule, when configuring Linux for a laptop, PCMCIA devices
  1318.   should only be configured from the PCMCIA device scripts.  Do not try
  1319.   to configure a PCMCIA device the same way you would configure a
  1320.   permanently attached device.  However, some Linux distributions
  1321.   provide PCMCIA packages that are hooked into those distributions' own
  1322.   device configuration tools.  In that case, some of the following
  1323.   sections may not apply; ideally, this will be documented by the
  1324.   distribution maintainers.
  1325.  
  1326.   44..33..  PPCCMMCCIIAA nneettwwoorrkk aaddaapptteerrss
  1327.  
  1328.   Linux ethernet-type network interfaces normally have names like eth0,
  1329.   eth1, and so on.  Token-ring adapters are handled similarly, however
  1330.   they are named tr0, tr1, and so on.  The ifconfig command is used to
  1331.   view or modify the state of a network interface.  A peculiarity of
  1332.   Linux is that network interfaces do not have corresponding device
  1333.   files under /dev, so do not be surprised when you do not find them.
  1334.  
  1335.   When an ethernet card is detected, it will be assigned the first free
  1336.   interface name, which will normally be eth0.  Cardmgr will run the
  1337.   /etc/pcmcia/network script to configure the interface, which normally
  1338.   reads network settings from /etc/pcmcia/network.opts.  The network and
  1339.   network.opts scripts will be executed only when your ethernet card is
  1340.   actually present.  If your system has an automatic network
  1341.   configuration facility, it may or may not be PCMCIA-aware.  Consult
  1342.   the documentation of your Linux distribution and the ``Notes about
  1343.   specific Linux distributions''  to determine if PCMCIA network devices
  1344.   should be configured with the automatic tools, or by editing
  1345.   network.opts.
  1346.  
  1347.   The device address passed to network.opts consists of four comma-
  1348.   separated fields: the scheme, the socket number, the device instance,
  1349.   and the card's hardware ethernet address.  The device instance is used
  1350.   to number devices for cards that have several network interfaces, so
  1351.   it will usually be 0.  If you have several network cards used for
  1352.   different purposes, one option would be to configure the cards based
  1353.   on socket position, as in:
  1354.  
  1355.        case "$ADDRESS" in
  1356.        *,0,*,*)
  1357.            # definitions for network card in socket 0
  1358.            ;;
  1359.        *,1,*,*)
  1360.            # definitions for network card in socket 1
  1361.            ;;
  1362.        esac
  1363.  
  1364.   Alternatively, they could be configured using their hardware
  1365.   addresses, as in:
  1366.  
  1367.        case "$ADDRESS" in
  1368.        *,*,*,00:80:C8:76:00:B1)
  1369.            # definitions for a D-Link card
  1370.            ;;
  1371.        *,*,*,08:00:5A:44:80:01)
  1372.            # definitions for an IBM card
  1373.        esac
  1374.  
  1375.   44..33..11..  NNeettwwoorrkk ddeevviiccee ppaarraammeetteerrss
  1376.  
  1377.   The following parameters can be defined in network.opts:
  1378.  
  1379.      IF_PORT
  1380.         Specifies the ethernet transceiver type, for cards that do not
  1381.         autodetect.  See ``man ifport'' for transceiver names.
  1382.  
  1383.      BOOTP
  1384.         A boolean (y/n) value: indicates if the host's IP address and
  1385.         routing information should be obtained using the BOOTP protocol.
  1386.  
  1387.      IPADDR
  1388.         The IP address for this interface.
  1389.      NETMASK, BROADCAST, NETWORK
  1390.         Basic network parameters: see the networking HOWTO for more
  1391.         information.
  1392.  
  1393.      GATEWAY
  1394.         The IP address of a gateway for this host's subnet.  Packets
  1395.         with destinations outside this subnet will be routed to this
  1396.         gateway.
  1397.  
  1398.      DOMAIN
  1399.         The local network domain name for this host, to be used in
  1400.         creating /etc/resolv.conf.
  1401.  
  1402.      SEARCH
  1403.         A search list for host name lookup, to be added to
  1404.         /etc/resolv.conf.  DOMAIN and SEARCH are mutually exclusive: see
  1405.         ``man resolver'' for more information.
  1406.  
  1407.      DNS_1, DNS_2, DNS_3
  1408.         Host names or IP addresses for nameservers for this interface,
  1409.         to be added to /etc/resolv.conf
  1410.  
  1411.      MOUNTS
  1412.         A list of NFS mount points to be mounted for this interface.
  1413.  
  1414.      IPX_FRAME, IPX_NETNUM
  1415.         For IPX networks: the frame type and network number, passed to
  1416.         the ipx_interface command.
  1417.  
  1418.   For example:
  1419.  
  1420.        case "$ADDRESS" in
  1421.        *,*,*,*)
  1422.            IF_PORT="10base2"
  1423.            BOOTP="n"
  1424.            IPADDR="10.0.0.1"
  1425.            NETMASK="255.255.255.0"
  1426.            NETWORK="10.0.0.0"
  1427.            BROADCAST="10.0.0.255"
  1428.            GATEWAY="10.0.0.1"
  1429.            DOMAIN="domain.org"
  1430.            DNS_1="dns1.domain.org"
  1431.            ;;
  1432.        esac
  1433.  
  1434.   To automatically mount and unmount NFS filesystems, first add all
  1435.   these filesystems to /etc/fstab, but include noauto in the mount
  1436.   options.  In network.opts, list the filesystem mount points in the
  1437.   MOUNTS variable.  It is especially important to use either cardctl or
  1438.   cardinfo to shut down a network card when NFS mounts are active.  It
  1439.   is not possible to cleanly unmount NFS filesystems if a network card
  1440.   is simply ejected without warning.
  1441.  
  1442.   In addition to the usual network configuration parameters, the
  1443.   network.opts script can specify extra actions to be taken after an
  1444.   interface is configured, or before an interface is shut down.  If
  1445.   network.opts defines a shell function called start_fn, it will be
  1446.   invoked by the network script after the interface is configured, and
  1447.   the interface name will be passed to the function as its first (and
  1448.   only) argument.  Similarly, if it is defined, stop_fn will be invoked
  1449.   before shutting down an interface.
  1450.   The transceiver type can be selected using the IF_PORT setting.  This
  1451.   can either be a numeric value as in previous PCMCIA releases, or a
  1452.   keyword identifying the transceiver type.  All the network drivers
  1453.   default to either autodetect the interface if possible, or 10baseT
  1454.   otherwise.  The ifport command can be used to check or set the current
  1455.   transceiver type.  For example:
  1456.  
  1457.        # ifport eth0 10base2
  1458.        #
  1459.        # ifport eth0
  1460.        eth0    2 (10base2)
  1461.  
  1462.   Current releases of the 3c589 driver attempt to autodetect the network
  1463.   connection, but this doesn't seem to be completely functional yet.
  1464.   For autodetection to work, the network cable should be connected to
  1465.   the card when the card is configured.  Alternatively, once the network
  1466.   is connected, you can force the driver to check the connection with:
  1467.  
  1468.        ifconfig eth0 down up
  1469.  
  1470.   44..33..22..  CCoommmmeennttss aabboouutt ssppeecciiffiicc ccaarrddss
  1471.  
  1472.   +o  With IBM CCAE and Socket EA cards, the transceiver type (10base2,
  1473.      10baseT, AUI) needs to be set when the network device is
  1474.      configured.  Make sure that the transceiver type reported in the
  1475.      system log matches your connection.
  1476.  
  1477.   +o  The drivers for SMC, Megahertz, Ositech, and 3Com cards should
  1478.      autodetect the attached network type (10base2 or 10baseT).  Setting
  1479.      the transceiver type when the driver is loaded serves to define the
  1480.      card's ``first guess''.
  1481.  
  1482.   +o  The Farallon EtherWave is actually based on the 3Com 3c589, with a
  1483.      special transceiver.  Though the EtherWave uses 10baseT-style
  1484.      connections, its transceiver requires that the 3c589 be configured
  1485.      in 10base2 mode.
  1486.  
  1487.   +o  If you have trouble with an IBM CCAE, NE4100, Thomas Conrad, or
  1488.      Kingston adapter, try increasing the memory access time with the
  1489.      mem_speed=# option to the pcnet_cs module.  An example of how to do
  1490.      this is given in the standard config.opts file.  Try speeds of up
  1491.      to 1000 (in nanoseconds).
  1492.  
  1493.   +o  For the New Media Ethernet adapter, on some systems, it may be
  1494.      necessary to increase the IO port access time with the io_speed=#
  1495.      option when the pcmcia_core module is loaded.  Edit CORE_OPTS in
  1496.      the startup script  to set this option.
  1497.  
  1498.   +o  The multicast support in the New Media Ethernet driver is
  1499.      incomplete.  The latest driver will function with multicast
  1500.      kernels, but will ignore multicast packets.  Promiscuous mode
  1501.      should work properly.
  1502.  
  1503.   +o  The driver used by the IBM and 3Com token ring adapters seems to
  1504.      behave very badly if the cards are not connected to a ring when
  1505.      they get initialized.  Always connect these cards to the net before
  1506.      they are powered up.  This driver also requires free IO ports in
  1507.      the range of 0xa20-0xa27.  On some systems, the automatic IO port
  1508.      conflict checker will incorrectly determine that this port range is
  1509.      unavailable.  In that case, the port check can be disabled by
  1510.      loading the pcmcia_core module with probe_io=0.
  1511.  
  1512.   +o  Some Linksys, D-Link, and IC-Card 10baseT/10base2 cards have a
  1513.      unique way of selecting the transceiver type that isn't handled by
  1514.      the Linux drivers.  One workaround is to boot DOS and use the
  1515.      vendor-supplied utility to select the transceiver, then warm boot
  1516.      Linux.  Alternatively, a Linux utility to perform this function is
  1517.      available at  <ftp://hyper.stanford.edu/extras/dlport.c>.
  1518.  
  1519.   +o  For WaveLAN wireless network adapters, Jean Tourrilhes
  1520.      (jt@hplb.hpl.hp.com) has put together a wireless HOWTO at
  1521.      <http://www-uk.hpl.hp.com/people/jt/Linux/Wavelan.html>.
  1522.  
  1523.   44..33..33..  DDiiaaggnnoossiinngg pprroobblleemmss wwiitthh nneettwwoorrkk aaddaapptteerrss
  1524.  
  1525.   +o  Is your card recognized as an ethernet card?  Check the system log
  1526.      and make sure that cardmgr identifies the card correctly and starts
  1527.      up one of the network drivers.  If it doesn't, your card might
  1528.      still be usable if it is compatible with a supported card.  This
  1529.      will be most easily done if the card claims to be ``NE2000
  1530.      compatible''.
  1531.  
  1532.   +o  Is the card configured properly?  If you are using a supported
  1533.      card, and it was recognized by cardmgr, but still doesn't work,
  1534.      there might be an interrupt or port conflict with another device.
  1535.      Find out what resources the card is using (from the system log),
  1536.      and try excluding these in /etc/pcmcia/config.opts to force the
  1537.      card to use something different.
  1538.  
  1539.   +o  If your card seems to be configured properly, but sometimes locks
  1540.      up, particularly under high load, you may need to try changing your
  1541.      socket driver timing parameters.  See the ``Startup options''
  1542.      section for more information.
  1543.  
  1544.   +o  If you get ``network unreachable'' messages when you try to access
  1545.      the network, then the routing information specified in
  1546.      /etc/pcmcia/network.opts is incorrect.  This message is an
  1547.      absolutely foolproof indication of a routing error.  On the other
  1548.      hand, mis-configured cards will usually fail silently.
  1549.  
  1550.   +o  To diagnose problems in /etc/pcmcia/network.opts, start by trying
  1551.      to ping other systems on the same subnet using their IP addresses.
  1552.      Then try to ping your gateway, and then machines on other subnets.
  1553.      Ping machines by name only after trying these simpler tests.
  1554.  
  1555.   +o  Make sure your problem is really a PCMCIA one.  It may help to see
  1556.      see if the card works under DOS with the vendor's drivers.  Double
  1557.      check your modifications to the /etc/pcmcia/network.opts script.
  1558.      Make sure your drop cable, ``T'' jack, terminator, etc are working.
  1559.  
  1560.   44..44..  PPCCMMCCIIAA sseerriiaall aanndd mmooddeemm ddeevviicceess
  1561.  
  1562.   Linux serial devices are accessed via the /dev/cua* and /dev/ttyS*
  1563.   special device files.  The ttyS* devices are for incoming connections,
  1564.   such as directly connected terminals.  The cua* devices are for
  1565.   outgoing connections, such as modems.  Each physical serial port has
  1566.   both a ttyS and a cua device file: it is up to you to pick the
  1567.   appropriate device for your application.  The configuration of a
  1568.   serial device can be examined and modified with the setserial command.
  1569.  
  1570.   When a serial or modem card is detected, it will be assigned to the
  1571.   first available serial device slot.  This will usually be /dev/ttyS1
  1572.   (cua1) or /dev/ttyS2 (cua2), depending on the number of built-in
  1573.   serial ports.  The ttyS* device is the one reported in /var/run/stab.
  1574.   The default serial device option script, /etc/pcmcia/serial.opts, will
  1575.   link the corresponding cua* device file to /dev/modem as a
  1576.   convenience.
  1577.  
  1578.   Do not try to use /etc/rc.d/rc.serial to configure a PCMCIA modem.
  1579.   This script should only be used to configure non-removable devices.
  1580.   Modify /etc/pcmcia/serial.opts if you want to do anything special to
  1581.   set up your modem.  Also, do not try to change the IO port and
  1582.   interrupt settings of a serial device using setserial.  This would
  1583.   tell the serial driver to look for the device in a different place,
  1584.   but would not change how the card's hardware is actually configured.
  1585.   The serial configuration script allows you to specify other setserial
  1586.   options, as well as whether a line should be added to /etc/inittab for
  1587.   this port.
  1588.  
  1589.   The device address passed to serial.opts has three comma-separated
  1590.   fields: the first is the scheme, the second  is the socket number, and
  1591.   the third is the device instance.  The device instance may take
  1592.   several values for cards that support multiple serial ports, but for
  1593.   single-port cards, it will always be 0.  If you commonly use more than
  1594.   one modem, you may want to specify different settings based on socket
  1595.   position, as in:
  1596.  
  1597.        case "$ADDRESS" in
  1598.        *,0,*)
  1599.            # Options for modem in socket 0
  1600.            LINK=/dev/modem0
  1601.            ;;
  1602.        *,1,*)
  1603.            # Options for modem in socket 1
  1604.            LINK=/dev/modem1
  1605.            ;;
  1606.        esac
  1607.  
  1608.   If a PCMCIA modem is already configured when Linux boots, it may be
  1609.   incorrectly identified as an ordinary built-in serial port.  This is
  1610.   harmless, however, when the PCMCIA drivers take control of the modem,
  1611.   it will be assigned a different device slot.  It is best to either
  1612.   parse /var/run/stab or use /dev/modem, rather than expecting a PCMCIA
  1613.   modem to always have the same device assignment.
  1614.  
  1615.   If you configure your kernel to load the basic Linux serial port
  1616.   driver as a module, you must edit /etc/pcmcia/config to indicate that
  1617.   this module must be loaded.  Edit the serial device entry to read:
  1618.  
  1619.        device "serial_cs"
  1620.          class "serial" module "misc/serial", "serial_cs"
  1621.  
  1622.   44..44..11..  SSeerriiaall ddeevviiccee ppaarraammeetteerrss
  1623.  
  1624.   The following parameters can be defined in serial.opts:
  1625.  
  1626.      LINK
  1627.         Specifies a path for a symbolic link to be created to the
  1628.         ``dialout'' or /dev/cua* device.
  1629.  
  1630.      SERIAL_OPTS
  1631.         Specifies options to be passed to the setserial command.
  1632.  
  1633.      INITTAB
  1634.         If specified, this will be used to construct an inittab entry
  1635.         for the device.
  1636.  
  1637.   For example:
  1638.  
  1639.        case "$ADDRESS" in
  1640.        *,*,*,*)
  1641.            LINK="/dev/modem"
  1642.            SERIAL_OPTS=""
  1643.            INITTAB="/sbin/getty"
  1644.  
  1645.   44..44..22..  DDiiaaggnnoossiinngg pprroobblleemmss wwiitthh sseerriiaall ddeevviicceess
  1646.  
  1647.   +o  Is your card recognized as a modem?  Check the system log and make
  1648.      sure that cardmgr identifies the card correctly and starts up the
  1649.      serial_cs driver.  If it doesn't, you may need to add a new entry
  1650.      to your /etc/pcmcia/config file so that it will be identified
  1651.      properly.  See the ``Configuring unrecognized cards'' section for
  1652.      details.
  1653.  
  1654.   +o  Is the modem configured successfully by serial_cs?  Again, check
  1655.      the system log and look for messages from the serial_cs driver.  If
  1656.      you see ``register_serial() failed'', you may have an I/O port
  1657.      conflict with another device.  Another tip-off of a conflict is if
  1658.      the device is reported to be an 8250; most modern modems should be
  1659.      identified as 16550A UART's.  If you think you're seeing a port
  1660.      conflict, edit /etc/pcmcia/config.opts and exclude the port range
  1661.      that was allocated for the modem.
  1662.  
  1663.   +o  Is there an interrupt conflict?  If the system log looks good, but
  1664.      the modem just doesn't seem to work, try using setserial to change
  1665.      the irq to 0, and see if the modem works.  This causes the serial
  1666.      driver to use a slower polled mode instead of using interrupts.  If
  1667.      this seems to fix the problem, it is likely that some other device
  1668.      in your system is using the interrupt selected by serial_cs.  You
  1669.      should add a line to /etc/pcmcia/config.opts to exclude this
  1670.      interrupt.
  1671.  
  1672.   +o  If the modem seems to work only very, very slowly, this is an
  1673.      almost certain indicator of an interrupt conflict.
  1674.  
  1675.   +o  Make sure your problem is really a PCMCIA one.  It may help to see
  1676.      if the card works under DOS with the vendor's drivers.  Also, don't
  1677.      test the card with something complex like SLIP or PPP until you are
  1678.      sure you can make simple connections.  If simple things work but
  1679.      SLIP does not, your problem is most likely with SLIP, not with
  1680.      PCMCIA.
  1681.  
  1682.   +o  If you get kernel messages indicating that the serial_cs module
  1683.      cannot be loaded, it means that your kernel does not have serial
  1684.      device support.  If you have compiled the serial driver as a
  1685.      module, you must modify /etc/pcmcia/config to indicate that the
  1686.      serial module should be loaded before serial_cs.
  1687.  
  1688.   44..55..  PPCCMMCCIIAA SSCCSSII aaddaapptteerrss
  1689.  
  1690.   All the currently supported PCMCIA SCSI cards are work-alikes of one
  1691.   of the following ISA bus cards: the Qlogic, the Adaptec AHA-152X, or
  1692.   the Future Domain TMC-16x0.  The PCMCIA drivers are built by linking
  1693.   some PCMCIA-specific code (in qlogic_cs.c, toaster_cs.c, or
  1694.   fdomain_cs.c) with the normal Linux SCSI driver.  Due to limitations
  1695.   in the Linux SCSI driver model, only one removable card per driver is
  1696.   supported.
  1697.  
  1698.   When a new SCSI host adapter is detected, the SCSI drivers will probe
  1699.   for devices.  Check the system log to make sure your devices are
  1700.   detected properly.  New SCSI devices will be assigned to the first
  1701.   available SCSI device files.  The first SCSI disk will be /dev/sda,
  1702.   the first SCSI tape will be /dev/st0, and the first CD-ROM will be
  1703.   /dev/scd0.
  1704.  
  1705.   With 1.3.X and later kernels, the PCMCIA core drivers are able to find
  1706.   out from the kernel which SCSI devices are connected to a card.  They
  1707.   will be listed in /var/run/stab, and the SCSI configuration script,
  1708.   /etc/pcmcia/scsi, will be called once for each attached device, to
  1709.   either configure or shut down that device.  The default script does
  1710.   not take any actions to configure SCSI devices, but will properly
  1711.   unmount filesystems on SCSI devices when a card is removed.
  1712.  
  1713.   With 1.2.X kernels, the PCMCIA drivers cannot automatically deduce
  1714.   which devices are associated with a particular SCSI adapter.  Instead,
  1715.   if you have one normal SCSI device configuration, you may list these
  1716.   devices in /etc/pcmcia/scsi.opts.  For example, if you normally have a
  1717.   SCSI disk and a CD-ROM, you would use:
  1718.  
  1719.        # For 1.2 kernels: list of attached devices
  1720.        SCSI_DEVICES="sda scd0"
  1721.  
  1722.   The device addresses passed to scsi.opts are complicated, because of
  1723.   the variety of things that can be attached to a SCSI adapter.
  1724.   Addresses consist of either six or seven comma-separated fields: the
  1725.   current scheme, the device type, the socket number, the SCSI channel,
  1726.   ID, and logical unit number, and optionally, the partition number.
  1727.   The device type will be ``sd'' for disks, ``st'' for tapes, ``sr'' for
  1728.   CD-ROM devices, and ``sg'' for generic SCSI devices.  For most setups,
  1729.   the SCSI channel and logical unit number will be 0.  For disk devices
  1730.   with several partitions, scsi.opts will first be called for the whole
  1731.   device, with a five-field address.  The script should set the PARTS
  1732.   variable to a list of partitions.  Then, scsi.opts will be called for
  1733.   each partition, with the longer seven-field addresses.
  1734.  
  1735.   If your kernel does not have a top-level driver (disk, tape, etc) for
  1736.   a particular SCSI device, then the device will not be configured by
  1737.   the PCMCIA drivers.  As a side effect, the device's name in
  1738.   /var/run/stab will be something like ``sd#nnnn'' where ``nnnn'' is a
  1739.   four-digit hex number.  This happens when cardmgr is unable to
  1740.   translate a SCSI device ID into a corresponding Linux device name.
  1741.  
  1742.   It is possible to modularize the top-level SCSI drivers so that they
  1743.   are loaded on demand.  To do so, you need to edit /etc/pcmcia/config
  1744.   to tell cardmgr which extra modules need to be loaded when your
  1745.   adapter is configured.  For example:
  1746.  
  1747.        device "aha152x_cs"
  1748.          class "scsi" module "scsi/scsi_mod", "scsi/sd_mod", "aha152x_cs"
  1749.  
  1750.   would say to load the core SCSI module and the top-level disk driver
  1751.   module before loading the regular PCMCIA driver module.  The PCMCIA
  1752.   Configure script will not automatically detect modularized SCSI
  1753.   modules, so you will need use the manual configure option to enable
  1754.   SCSI support.
  1755.  
  1756.   Always turn on SCSI devices before powering up your laptop, or before
  1757.   inserting the adapter card, so that the SCSI bus is properly
  1758.   terminated when the adapter is configured.  Also be very careful about
  1759.   ejecting a SCSI adapter.  Be sure that all associated SCSI devices are
  1760.   unmounted and closed before ejecting the card.  The best way to ensure
  1761.   this is to use either cardctl or cardinfo to request card removal
  1762.   before physically ejecting the card.  For now, all SCSI devices should
  1763.   be powered up before plugging in a SCSI adapter, and should stay
  1764.   connected until after you unplug the adapter and/or power down your
  1765.   laptop.
  1766.  
  1767.   There is a potential complication when using these cards that does not
  1768.   arise with ordinary ISA bus adapters.  The SCSI bus carries a
  1769.   ``termination power'' signal that is necessary for proper operation of
  1770.   ordinary passive SCSI terminators.  PCMCIA SCSI adapters do not supply
  1771.   termination power, so if it is required, an external device must
  1772.   supply it.  Some external SCSI devices may be configured to supply
  1773.   termination power.  Others, such as the Zip Drive and the Syquest EZ-
  1774.   Drive, use active terminators that do not depend on it.  In some
  1775.   cases, it may be necessary to use a special terminator block such as
  1776.   the APS SCSI Sentry 2, which has an external power supply.  When
  1777.   configuring your SCSI device chain, be aware of whether or not any of
  1778.   your devices require or can provide termination power.
  1779.  
  1780.   44..55..11..  SSCCSSII ddeevviiccee ppaarraammeetteerrss
  1781.  
  1782.   The following parameters can be defined in scsi.opts:
  1783.  
  1784.      DO_FSTAB
  1785.         A boolean (y/n) setting: specifies if an entry should be added
  1786.         to /etc/fstab for this device.
  1787.  
  1788.      DO_FSCK
  1789.         A boolean (y/n) setting: specifies if the filesystem should be
  1790.         checked before being mounted, with ``fsck -Ta''.
  1791.  
  1792.      DO_MOUNT
  1793.         A boolean (y/n) setting: specifies if this device should be
  1794.         automatically mounted at card insertion time.
  1795.  
  1796.      FSTYPE, OPTS, MOUNTPT
  1797.         The filesystem type, mount options, and mount point to be used
  1798.         for the fstab entry and/or mounting the device.
  1799.  
  1800.   For example, here is a script for configuring a disk device at SCSI ID
  1801.   3, with two partitions, and a CD-ROM at SCSI ID 6:
  1802.  
  1803.        case "$ADDRESS" in
  1804.        *,sd,*,0,3,0)
  1805.            # This device has two partitions...
  1806.            PARTS="1 2"
  1807.            ;;
  1808.        *,sd,*,0,3,0,1)
  1809.            # Options for partition 1:
  1810.            #  update /etc/fstab, and mount an ext2 fs on /usr1
  1811.            DO_FSTAB="y" ; DO_FSCK="y" ; DO_MOUNT="y"
  1812.            FSTYPE="ext2"
  1813.            OPTS=""
  1814.            MOUNTPT="/usr1"
  1815.            ;;
  1816.        *,sd,*,0,3,0,2)
  1817.            # Options for partition 2:
  1818.            #  update /etc/fstab, and mount an MS-DOS fs on /usr2
  1819.            DO_FSTAB="y" ; DO_FSCK="y" ; DO_MOUNT="y"
  1820.            FSTYPE="msdos"
  1821.            OPTS=""
  1822.            MOUNTPT="/usr2"
  1823.            ;;
  1824.        *,sr,*,0,6,0)
  1825.            # Options for CD-ROM at SCSI ID 6
  1826.            PARTS=""
  1827.            DO_FSTAB="y" ; DO_FSCK="n" ; DO_MOUNT="y"
  1828.            FSTYPE="iso9660"
  1829.            OPTS="ro"
  1830.            MOUNTPT="/cdrom"
  1831.            ;;
  1832.        esac
  1833.  
  1834.   44..55..22..  CCoommmmeennttss aabboouutt ssppeecciiffiicc ccaarrddss
  1835.  
  1836.   +o  The Adaptec APA-1480 CardBus card needs a large IO port window (256
  1837.      contiguous ports aligned on a 256-port boundary).  It may be
  1838.      necessary to expand the IO port regions in /etc/pcmcia/config.opts
  1839.      to guarantee that such a large window can be found.
  1840.  
  1841.   +o  The Adaptec APA-460 SlimSCSI adapter is not supported.  This card
  1842.      was originally sold under the Trantor name, and when Adaptec merged
  1843.      with Trantor, they continued to sell the Trantor card with an
  1844.      Adaptec label.  The APA-460 is not compatible with any existing
  1845.      Linux driver.
  1846.  
  1847.   +o  I have had one report of a bad interaction between the New Media
  1848.      Bus Toaster and a UMAX Astra 1200s scanner.  Due to the complexity
  1849.      of the SCSI protocol, when diagnosing problems with SCSI devices,
  1850.      it is worth considering that incompatible combinations like this
  1851.      may exist and may not be documented.
  1852.  
  1853.   44..55..33..  DDiiaaggnnoossiinngg pprroobblleemmss wwiitthh SSCCSSII aaddaapptteerrss
  1854.  
  1855.   +o  With the aha152x_cs driver (used by Adaptec, New Media, and a few
  1856.      others), it seems that SCSI disconnect/reconnect support is a
  1857.      frequent source of trouble with tape drives.  To disable this
  1858.      ``feature,'' add the following to /etc/pcmcia/config.opts:
  1859.  
  1860.        module "aha152x_cs" opts "reconnect=0"
  1861.  
  1862.   +o  If you have compiled SCSI support as modules (CONFIG_SCSI is
  1863.      ``m''), when configuring PCMCIA, you must explicitly specify that
  1864.      you want the SCSI drivers to be built.  You must also modify
  1865.      /etc/pcmcia/config to load the SCSI modules before the appropriate
  1866.      *_cs driver is loaded.
  1867.  
  1868.   +o  If you get ``aborting command due to timeout'' messages when the
  1869.      SCSI bus is probed, you almost certainly have an interrupt
  1870.      conflict.
  1871.  
  1872.   +o  If the host driver reports ``no SCSI devices found'', verify that
  1873.      your kernel was compiled with the appropriate top-level SCSI
  1874.      drivers for your devices (i.e., disk, tape, CD-ROM, and/or
  1875.      generic).  If a top-level driver is missing, devices of that type
  1876.      will be ignored.
  1877.  
  1878.   44..66..  PPCCMMCCIIAA mmeemmoorryy ccaarrddss
  1879.  
  1880.   The memory_cs driver handles all types of memory cards, as well as
  1881.   providing direct access to the PCMCIA memory address space for cards
  1882.   that have other functions.  When loaded, it creates a combination of
  1883.   character and block devices.  See the man page for the module for a
  1884.   complete description of the device naming scheme.  Block devices are
  1885.   used for disk-like access (creating and mounting filesystems, etc).
  1886.   The character devices are for "raw" unbuffered reads and writes at
  1887.   arbitrary locations.
  1888.  
  1889.   The device address passed to memory.opts consists of two fields: the
  1890.   scheme, and the socket number.  The options are applied to the first
  1891.   common memory partition on the corresponding memory card.
  1892.  
  1893.   Some older memory cards, and most simple static RAM cards, lack a
  1894.   ``Card Information Structure'' (CIS), which is the scheme PCMCIA cards
  1895.   use to identify themselves.  Normally, cardmgr will assume that any
  1896.   card that lacks a CIS is a simple memory card, and load the memory_cs
  1897.   driver.  Thus, a common side effect of a general card identification
  1898.   problem is that other types of cards may be misdetected as memory
  1899.   cards.
  1900.  
  1901.   The memory_cs driver uses a heuristic to guess the capacity of these
  1902.   cards.  The heuristic does not work for write protected cards, and may
  1903.   make mistakes in some other cases as well.  If a card is misdetected,
  1904.   its size should then be explicitly specified when using commands such
  1905.   as dd or mkfs.
  1906.  
  1907.   44..66..11..  MMeemmoorryy ddeevviiccee ppaarraammeetteerrss
  1908.  
  1909.   The following parameters can be specified in memory.opts:
  1910.  
  1911.      DO_FSTAB
  1912.         A boolean (y/n) setting: specifies if an entry should be added
  1913.         to /etc/fstab for this device.
  1914.  
  1915.      DO_FSCK
  1916.         A boolean (y/n) setting: specifies if the filesystem should be
  1917.         checked before being mounted, with ``fsck -Ta''.
  1918.  
  1919.      DO_MOUNT
  1920.         A boolean (y/n) setting: specifies if this device should be
  1921.         automatically mounted at card insertion time.
  1922.  
  1923.      FSTYPE, OPTS, MOUNTPT
  1924.         The filesystem type, mount options, and mount point to be used
  1925.         for the fstab entry and/or mounting the device.
  1926.  
  1927.   Here is an example of a script that will automatically mount memory
  1928.   cards based on which socket they are inserted into:
  1929.  
  1930.        case "$ADDRESS" in
  1931.        *,0,0)
  1932.            # Mount filesystem, but don't update /etc/fstab
  1933.            DO_FSTAB="n" ; DO_FSCK="y" ; DO_MOUNT="y"
  1934.            FSTYPE="ext2" ; OPTS=""
  1935.            MOUNTPT="/mem0"
  1936.            ;;
  1937.        *,1,0)
  1938.            # Mount filesystem, but don't update /etc/fstab
  1939.            DO_FSTAB="n" ; DO_FSCK="y" ; DO_MOUNT="y"
  1940.            FSTYPE="ext2" ; OPTS=""
  1941.            MOUNTPT="/mem1"
  1942.            ;;
  1943.        esac
  1944.  
  1945.   44..66..22..  UUssiinngg ffllaasshh mmeemmoorryy ccaarrddss
  1946.  
  1947.   The device address passed to ftl.opts consists of three or four
  1948.   fields: the scheme, the socket number, the region number, and
  1949.   optionally, the partition number.  Most flash cards have just one
  1950.   flash memory region, so the region number will generally always be
  1951.   zero.
  1952.  
  1953.   To use a flash memory card as an ordinary disk-like block device,
  1954.   first create an FTL, or ``flash translation layer'', partition on the
  1955.   device with the ftl_format command.  This layer hides the device-
  1956.   specific details of flash memory programming and make the card look
  1957.   like a simple block device.  For example:
  1958.  
  1959.        ftl_format -i /dev/mem0c0c
  1960.  
  1961.   Note that this command accesses the card through the ``raw'' memory
  1962.   card interface.  Once formatted, the card can be accessed as an
  1963.   ordinary block device via the ftl_cs driver.  For example:
  1964.  
  1965.   mke2fs /dev/ftl0c0
  1966.   mount -t ext2 /dev/ftl0c0 /mnt
  1967.  
  1968.   Device naming for FTL devices is tricky.  Minor device numbers have
  1969.   three parts: the card number, the region number on that card, and
  1970.   optionally, the partition within that region.  A region can either be
  1971.   treated as a single block device with no partition table (like a
  1972.   floppy), or it can be partitioned like a hard disk device.  The
  1973.   ``ftl0c0'' device is card 0, common memory region 0, the entire
  1974.   region.  The ``ftl0c0p1'' through ``ftl0c0p4'' devices are primary
  1975.   partitions 1 through 4 if the region has been partitioned.
  1976.  
  1977.   There are two major formats for flash memory cards: the FTL style, and
  1978.   the Microsoft Flash File System.  The FTL format is generally more
  1979.   flexible because it allows any ordinary high-level filesystem (ext2,
  1980.   ms-dos, etc) to be used on a flash card as if it were an ordinary disk
  1981.   device.  The FFS is a completely different filesystem type.  Linux
  1982.   cannot currently handle cards formated with FFS.
  1983.  
  1984.   Intel Series 100 flash cards use the first 128K flash block to store
  1985.   the cards' configuration information.  To prevent accidental erasure
  1986.   of this information, ftl_format will automatically detect this and
  1987.   skip the first block when creating an FTL partition.
  1988.  
  1989.   44..77..  PPCCMMCCIIAA AATTAA//IIDDEE ccaarrdd ddrriivveess
  1990.  
  1991.   ATA/IDE drive support requires a 1.3.72 or higher kernel.  The PCMCIA-
  1992.   specific part of the driver is ide_cs.  Be sure to use cardctl or
  1993.   cardinfo to shut down an ATA/IDE card before ejecting it, as the
  1994.   driver has not been made ``hot-swap-proof''.
  1995.  
  1996.   The device addresses passed to ide.opts consist of either three or
  1997.   four fields: the current scheme, the socket number, the drive's serial
  1998.   number, and an optional partition number.  The ide_info command can be
  1999.   used to obtain an IDE device's serial number.  As with SCSI devices,
  2000.   ide.opts is first called for the entire device.  If ide.opts returns a
  2001.   list of partitions in the PARTS variable, the script will then be
  2002.   called for each partition.
  2003.  
  2004.   44..77..11..  AATTAA//IIDDEE ffiixxeedd--ddiisskk ddeevviiccee ppaarraammeetteerrss
  2005.  
  2006.   The following parameters can be specified in ide.opts:
  2007.  
  2008.      DO_FSTAB
  2009.         A boolean (y/n) setting: specifies if an entry should be added
  2010.         to /etc/fstab for this device.
  2011.  
  2012.      DO_FSCK
  2013.         A boolean (y/n) setting: specifies if the filesystem should be
  2014.         checked before being mounted, with ``fsck -Ta''.
  2015.  
  2016.      DO_MOUNT
  2017.         A boolean (y/n) setting: specifies if this device should be
  2018.         automatically mounted at card insertion time.
  2019.  
  2020.      FSTYPE, OPTS, MOUNTPT
  2021.         The filesystem type, mount options, and mount point to be used
  2022.         for the fstab entry and/or mounting the device.
  2023.  
  2024.   Here is an example ide.opts file to mount the first partition of any
  2025.   ATA/IDE card on /mnt.
  2026.  
  2027.        case "$ADDRESS" in
  2028.        *,*,*,1)
  2029.            DO_FSTAB="y" ; DO_FSCK="y" ; DO_MOUNT="y"
  2030.            FSTYPE="msdos"
  2031.            OPTS=""
  2032.            MOUNTPT="/mnt"
  2033.            ;;
  2034.        *,*,*)
  2035.            PARTS="1"
  2036.            ;;
  2037.        esac
  2038.  
  2039.   44..77..22..  DDiiaaggnnoossiinngg pprroobblleemmss wwiitthh AATTAA//IIDDEE aaddaapptteerrss
  2040.  
  2041.   +o  Some IDE drives violate the PCMCIA specification by requiring a
  2042.      longer time to spin up than the maximum allowed card setup time.
  2043.      Starting with release 3.0.6, the ide_cs driver will automatically
  2044.      retry the device probe to give these drives time to spin up.  With
  2045.      older drivers, you may need to load the pcmcia_core module with:
  2046.  
  2047.        CORE_OPTS="unreset_delay=400"
  2048.  
  2049.   +o  To use an ATA/IDE CD-ROM device, your kernel must be compiled with
  2050.      CONFIG_BLK_DEV_IDECD enabled.  This will normally be the case for
  2051.      standard kernels, however it is something to be aware of if you
  2052.      compile a custom kernel.
  2053.  
  2054.   44..88..  MMuullttiiffuunnccttiioonn ccaarrddss
  2055.  
  2056.   Starting with the 1.3.73 Linux kernel, a single interrupt can be
  2057.   shared by several drivers, such as the serial driver and an ethernet
  2058.   driver.  When using a multifunction card under a newer kernel, all
  2059.   card functions can be used without loading and unloading drivers.
  2060.  
  2061.   Simultaneous use of two card functions is ``tricky'' and various
  2062.   hardware vendors have implemented interrupt sharing in their own
  2063.   incompatible (and sometimes proprietary) ways.  The drivers for some
  2064.   cards (Ositech Jack of Diamonds, 3Com 3c562, Linksys) properly support
  2065.   simultaneous access, but others (Megahertz in particular) do not.
  2066.  
  2067.   Earlier kernels do not support interrupt sharing between different
  2068.   device drivers, so it is not possible for the PCMCIA drivers to
  2069.   configure this card for simultaneous ethernet and modem access.  The
  2070.   ethernet and serial drivers are both loaded automatically.  However,
  2071.   the ethernet driver ``owns'' the card interrupt by default.  To use
  2072.   the modem, you can unload the ethernet driver and reconfigure the
  2073.   serial port by doing something like:
  2074.  
  2075.   ifconfig eth0 down
  2076.   rmmod 3c589_cs
  2077.   setserial /dev/modem autoconfig auto_irq
  2078.   setserial /dev/modem
  2079.  
  2080.   The second setserial should verify that the port has been configured
  2081.   to use the interrupt previously used by the ethernet driver.
  2082.  
  2083.   55..  AAddvvaanncceedd ttooppiiccss
  2084.  
  2085.   55..11..  RReessoouurrccee aallllooccaattiioonn ffoorr PPCCMMCCIIAA ddeevviicceess
  2086.  
  2087.   In theory, it should not really matter which interrupt is allocated to
  2088.   which device, as long as two devices are not configured to use the
  2089.   same interrupt.  In /etc/pcmcia/config.opts you'll find a place for
  2090.   excluding interrupts that are used by non-PCMCIA devices.
  2091.  
  2092.   Similarly, there is no way to directly specify the I/O addresses for a
  2093.   card to use.  The /etc/pcmcia/config.opts file allows you to specify
  2094.   ranges of ports available for use by any card, or to exclude ranges
  2095.   that conflict with other devices.
  2096.  
  2097.   After modifying /etc/pcmcia/config.opts, you can restart cardmgr with
  2098.   ``kill -HUP''.
  2099.  
  2100.   The interrupt used to monitor card status changes is chosen by the
  2101.   low-level socket driver module (i82365 or tcic) before cardmgr parses
  2102.   /etc/pcmcia/config, so it is not affected by changes to this file.  To
  2103.   set this interrupt, use the cs_irq= option when the socket driver is
  2104.   loaded, by setting the PCIC_OPTS variable in /etc/rc.d/rc.pcmcia.
  2105.  
  2106.   All the client card drivers have a parameter called irq_list for
  2107.   specifying which interrupts they may try to allocate.  These driver
  2108.   options should be set in your /etc/pcmcia/config file.  For example:
  2109.  
  2110.        device "serial_cs"
  2111.          module "serial_cs" opts "irq_list=8,12"
  2112.          ...
  2113.  
  2114.   would specify that the serial driver should only use irq 8 or irq 12.
  2115.   Regardless of irq_list settings, Card Services will never allocate an
  2116.   interrupt that is already in use by another device, or an interrupt
  2117.   that is excluded in the config file.
  2118.  
  2119.   55..22..  HHooww ccaann II hhaavvee sseeppaarraattee ddeevviiccee sseettuuppss ffoorr hhoommee aanndd wwoorrkk??
  2120.  
  2121.   This is fairly easy using ``scheme'' support.  Use two configuration
  2122.   schemes, called ``home'' and ``work''.  Here is an example of a
  2123.   network.opts script with scheme-specific settings:
  2124.  
  2125.   case "$ADDRESS" in
  2126.   work,*,*,*)
  2127.       # definitions for network card in work scheme
  2128.       ...
  2129.       ;;
  2130.   home,*,*,*|default,*,*,*)
  2131.       # definitions for network card in home scheme
  2132.       ...
  2133.       ;;
  2134.   esac
  2135.  
  2136.   The first part of a device address is always the configuration scheme.
  2137.   In this example, the second ``case'' clause will select for both the
  2138.   ``home'' and ``default'' schemes.  So, if the scheme is unset for any
  2139.   reason, it will default to the ``home'' setup.
  2140.  
  2141.   Now, to select between the two sets of settings, run either:
  2142.  
  2143.        cardctl scheme home
  2144.  
  2145.   or
  2146.  
  2147.        cardctl scheme work
  2148.  
  2149.   The cardctl command does the equivalent of shutting down all your
  2150.   cards and restarting them.  The command can be safely executed whether
  2151.   or not the PCMCIA system is loaded, but the command may fail if you
  2152.   are using other PCMCIA devices at the time (even if their
  2153.   configurations are not explicitly dependant on the scheme setting).
  2154.  
  2155.   To find out the current scheme setting, run:
  2156.  
  2157.        cardctl scheme
  2158.  
  2159.   By default, the scheme setting is persistent across boots.  This can
  2160.   have undesirable effects if networking is initialized for the wrong
  2161.   environment.  Optionally, you can set the initial scheme value with
  2162.   the SCHEME startup option (see ``Startup options'' for details).  It
  2163.   is also possible to set the scheme from the lilo boot prompt.  Since
  2164.   lilo passes unrecognized options to init as environment variables, a
  2165.   value for SCHEME (or any other PCMCIA startup option) at the boot
  2166.   prompt will be propagated into the PCMCIA startup script.
  2167.  
  2168.   To save even more keystrokes, schemes can be specified in lilo's
  2169.   configuration file.  For instance, you could have:
  2170.  
  2171.   root = /dev/hda1
  2172.   read-only
  2173.   image = /boot/vmlinuz
  2174.     label  = home
  2175.     append = "SCHEME=home"
  2176.   image = /boot/vmlinuz
  2177.     label  = work
  2178.     append = "SCHEME=work"
  2179.  
  2180.   Typing ``home'' or ``work'' at the boot prompt would then boot into
  2181.   the appropriate scheme.
  2182.  
  2183.   55..33..  BBoooottiinngg ffrroomm aa PPCCMMCCIIAA ddeevviiccee
  2184.  
  2185.   Having the root filesystem on a PCMCIA device is tricky because the
  2186.   Linux PCMCIA system is not designed to be linked into the kernel.  Its
  2187.   core components, the loadable kernel modules and the user mode cardmgr
  2188.   daemon, depend on an already running system.  The kernel's ``initrd''
  2189.   facility works around this requirement by allowing Linux to boot using
  2190.   a temporary ram disk as a minimal root image, load drivers, and then
  2191.   re-mount a different root filesystem.  The temporary root can
  2192.   configure PCMCIA devices and then re-mount a PCMCIA device as root.
  2193.  
  2194.   The initrd image absolutely must reside on a bootable device: this
  2195.   generally cannot be put on a PCMCIA device.  This is a BIOS
  2196.   limitation, not a kernel limitation.  It is useful here to distinguish
  2197.   between ``boot-able'' devices (i.e., devices that can be booted), and
  2198.   ``root-able'' devices (i.e., devices that can be mounted as root).
  2199.   ``Boot-able'' devices are determined by the BIOS, and are generally
  2200.   limited to internal floppy and hard disk drives.  ``Root-able''
  2201.   devices are any block devices that the kernel supports once it has
  2202.   been loaded.  The initrd facility makes more devices ``root-able'',
  2203.   not ``boot-able''.
  2204.  
  2205.   Some Linux distributions will allow installation to a device connected
  2206.   to a PCMCIA SCSI adapter, as an unintended side-effect of their
  2207.   support for installs from PCMCIA SCSI CD-ROM devices.  However, at
  2208.   present, no Linux installation tools support configuring an
  2209.   appropriate ``initrd'' to boot Linux with a PCMCIA root filesystem.
  2210.   Setting up a system with a PCMCIA root thus requires that you use
  2211.   another Linux system to create the ``initrd'' image.  If another Linux
  2212.   system is not available, another option would be to temporarily
  2213.   install a minimal Linux setup on a non-PCMCIA drive, create an initrd
  2214.   image, and then reinstall to the PCMCIA target.
  2215.  
  2216.   The Linux Bootdisk-HOWTO has some general information about setting up
  2217.   boot disks but nothing specific to initrd.  The main initrd document
  2218.   is included with recent kernel source code distributions, in
  2219.   linux/Documentation/initrd.txt.  Before beginning, you should read
  2220.   this document.  A familiarity with lilo is also helpful.  Using initrd
  2221.   also requires that you have a kernel compiled with CONFIG_BLK_DEV_RAM
  2222.   and CONFIG_BLK_DEV_INITRD enabled.
  2223.  
  2224.   This is an advanced configuration technique, and requires a high level
  2225.   of familiarity with Linux and the PCMCIA system.  Be sure to read all
  2226.   the relevant documentation before starting.  The following cookbook
  2227.   instructions should work, but deviations from the examples will
  2228.   quickly put you in uncharted and ``unsupported'' territory, and you
  2229.   will be on your own.
  2230.  
  2231.   This method absolutely requires that you use a PCMCIA driver release
  2232.   of 2.9.5 or later.  Older PCMCIA packages or individual components
  2233.   will not work in the initrd context.  Do not mix components from
  2234.   different releases.
  2235.  
  2236.   55..33..11..  TThhee ppcciinniittrrdd hheellppeerr ssccrriipptt
  2237.  
  2238.   The pcinitrd script creates a basic initrd image for booting with a
  2239.   PCMCIA root partition.  The image includes a minimal directory
  2240.   heirarchy, a handful of device files, a few binaries, shared
  2241.   libraries, and a set of PCMCIA driver modules.  When invoking
  2242.   pcinitrd, you specify the driver modules that you want to be included
  2243.   in the image.  The core PCMCIA components, pcmcia_core and ds, are
  2244.   automatically included.
  2245.  
  2246.   As an example, say that your laptop uses an i82365-compatible host
  2247.   controller, and you want to boot Linux with the root filesystem on a
  2248.   hard drive attached to an Adaptec SlimSCSI adapter.  You could create
  2249.   an appropriate initrd image with:
  2250.  
  2251.        pcinitrd -v initrd pcmcia/i82365.o pcmcia/aha152x_cs.o
  2252.  
  2253.   To customize the initrd startup sequence, you could mount the image
  2254.   using the ``loopback'' device with a command like:
  2255.  
  2256.        mount -o loop -t ext2 initrd /mnt
  2257.  
  2258.   and then edit the linuxrc script.  The configuration files will be
  2259.   installed under /etc in the image, and can also be customized.  See
  2260.   the man page for pcinitrd for more information.
  2261.  
  2262.   55..33..22..  CCrreeaattiinngg aann iinniittrrdd bboooott ffllooppppyy
  2263.  
  2264.   After creating an image with pcinitrd, you can create a boot floppy by
  2265.   copying the kernel, the compressed initrd image, and a few support
  2266.   files for lilo to a clean floppy.  In the following example, we assume
  2267.   that the desired PCMCIA root device is /dev/sda1:
  2268.  
  2269.        mke2fs /dev/fd0
  2270.        mount /dev/fd0 /mnt
  2271.        mkdir /mnt/etc /mnt/boot /mnt/dev
  2272.        cp -a /dev/fd0 /dev/sda1 /mnt/dev
  2273.        cp [kernel-image] /mnt/vmlinuz
  2274.        cp /boot/boot.b /mnt/boot/boot.b
  2275.        gzip < [initrd-image] > /mnt/initrd
  2276.  
  2277.   Create /mnt/etc/lilo.conf with the contents:
  2278.  
  2279.        boot=/dev/fd0
  2280.        compact
  2281.        image=/vmlinuz
  2282.            label=linux
  2283.            initrd=/initrd
  2284.            read-only
  2285.            root=/dev/sda1
  2286.  
  2287.   Finally, invoke lilo with:
  2288.  
  2289.        lilo -r /mnt
  2290.  
  2291.   When lilo is invoked with -r, it performs all actions relative to the
  2292.   specified alternate root directory.  The reason for creating the
  2293.   device files under /mnt/dev was that lilo will not be able to use the
  2294.   files in /dev when it is running in this alternate-root mode.
  2295.  
  2296.   55..33..33..  IInnssttaalllliinngg aann iinniittrrdd iimmaaggee oonn aa nnoonn--LLiinnuuxx ddrriivvee
  2297.  
  2298.   One common use of the initrd facility would be on systems where the
  2299.   internal hard drive is dedicated to another operating system.  The
  2300.   Linux kernel and initrd image can be placed in a non-Linux partition,
  2301.   and lilo or LOADLIN can be set up to boot Linux from these images.
  2302.  
  2303.   Assuming that you have a kernel has been configured for the
  2304.   appropriate root device, and an initrd image created on another
  2305.   system, the easiest way to get started is to boot Linux using LOADLIN,
  2306.   as:
  2307.  
  2308.        LOADLIN <kernel> initrd=<initrd-image>
  2309.  
  2310.   Once you can boot Linux on your target machine, you could then install
  2311.   lilo to allow booting Linux directly.  For example, say that /dev/hda1
  2312.   is the non-Linux target partition and /mnt can be used as a mount
  2313.   point.  First, create a subdirectory on the target for the Linux
  2314.   files:
  2315.  
  2316.        mount /dev/hda1 /mnt
  2317.        mkdir /mnt/linux
  2318.        cp [kernel-image] /mnt/linux/vmlinuz
  2319.        cp [initrd-image] /mnt/linux/initrd
  2320.  
  2321.   In this example, say that /dev/sda1 is the desired Linux root
  2322.   partition, a SCSI hard drive mounted via a PCMCIA SCSI adapter.  To
  2323.   install lilo, create a lilo.conf file with the contents:
  2324.  
  2325.        boot=/dev/hda
  2326.        map=/mnt/linux/map
  2327.        compact
  2328.        image=/mnt/linux/vmlinuz
  2329.                label=linux
  2330.                root=/dev/sda1
  2331.                initrd=/mnt/linux/initrd
  2332.                read-only
  2333.        other=/dev/hda1
  2334.                table=/dev/hda
  2335.                label=windows
  2336.  
  2337.   The boot= line says to install the boot loader in the master boot
  2338.   record of the specified device.  The root= line identifies the desired
  2339.   root filesystem to be used after loading the initrd image, and may be
  2340.   unnecessary if the kernel image is already configured this way.  The
  2341.   other= section is used to describe the other operating system
  2342.   installed on /dev/hda1.
  2343.  
  2344.   To install lilo in this case, use:
  2345.  
  2346.        lilo -C lilo.conf
  2347.  
  2348.   Note that in this case, the lilo.conf file uses absolute paths that
  2349.   include /mnt.  I did this in the example because the target filesystem
  2350.   may not support the creation of Linux device files for the boot= and
  2351.   root= options.
  2352.  
  2353.   66..  DDeeaalliinngg wwiitthh uunnssuuppppoorrtteedd ccaarrddss
  2354.  
  2355.   66..11..  CCoonnffiigguurriinngg uunnrreeccooggnniizzeedd ccaarrddss
  2356.  
  2357.   Assuming that your card is supported by an existing driver, all that
  2358.   needs to be done is to add an entry to /etc/pcmcia/config to tell
  2359.   cardmgr how to identify the card, and which driver(s) need to be
  2360.   linked up to this card.  Check the man page for pcmcia for more
  2361.   information about the config file format.  If you insert an unknown
  2362.   card, cardmgr will normally record some identification information in
  2363.   the system log that can be used to construct the config entry.  This
  2364.   information can also be displayed with the ``cardctl ident'' command.
  2365.  
  2366.   Here is an example of how cardmgr will report an unsupported card in
  2367.   /usr/adm/messages.
  2368.  
  2369.        cardmgr[460]: unsupported card in socket 1
  2370.        cardmgr[460]: product info: "MEGAHERTZ", "XJ2288", "V.34 PCMCIA MODEM"
  2371.        cardmgr[460]: manfid: 0x0101, 0x1234  function: 2 (serial)
  2372.  
  2373.   The corresponding entry in /etc/pcmcia/config would be:
  2374.  
  2375.        card "Megahertz XJ2288 V.34 Fax Modem"
  2376.          version "MEGAHERTZ", "XJ2288", "V.34 PCMCIA MODEM"
  2377.          bind "serial_cs"
  2378.  
  2379.   You can use ``*'' to match strings that don't need to match exactly,
  2380.   like version numbers.  When making new config entries, be careful to
  2381.   copy the strings exactly, preserving case and blank spaces.  Also be
  2382.   sure that the config entry has the same number of strings as are
  2383.   reported in the log file.
  2384.  
  2385.   Beware that you can specify just about any driver for a card, but if
  2386.   you're just shooting in the dark, there is not much reason to expect
  2387.   this to be productive.  You may get lucky and find that your card is
  2388.   supported by an existing driver.  However, the most likely outcome is
  2389.   that the driver won't work, and may have unfortunate side effects like
  2390.   locking up your system.  Unlike most ordinary device drivers, which
  2391.   probe for an appropriate card, the probe for a PCMCIA device is done
  2392.   by cardmgr, and the driver itself may not do much validation before
  2393.   attempting to communicate with the device.
  2394.  
  2395.   After editing /etc/pcmcia/config, you can signal cardmgr to reload the
  2396.   file with:
  2397.  
  2398.        kill -HUP `cat /var/run/cardmgr.pid`
  2399.  
  2400.   If you do set up an entry for a new card, please send me a copy so
  2401.   that I can include it in the standard config file.
  2402.  
  2403.   66..22..  AAddddiinngg ssuuppppoorrtt ffoorr aann NNEE22000000--ccoommppaattiibbllee eetthheerrnneett ccaarrdd
  2404.  
  2405.   Before you begin: this procedure will only work for simple ethernet
  2406.   cards.  Multifunction cards (i.e., ethernet/modem combo cards) have an
  2407.   extra layer of complexity regarding how the two functions are
  2408.   integrated, and generally cannot be supported without obtaining some
  2409.   configuration information from the card vendor.  Using the following
  2410.   procedure for a multifunction card will not be productive.
  2411.  
  2412.   First, see if the card is already recognized by cardmgr.  Some cards
  2413.   not listed in SUPPORTED.CARDS are actually OEM versions of cards that
  2414.   are supported.  If you find a card like this, let me know so I can add
  2415.   it to the list.
  2416.  
  2417.   If your card is not recognized, follow the instructions in the
  2418.   ``Configuring unrecognized cards'' section to create a config entry
  2419.   for your card, and bind the card to the pcnet_cs driver.  Restart
  2420.   cardmgr to use the updated config file.
  2421.  
  2422.   If the pcnet_cs driver says that it is unable to determine your card's
  2423.   hardware ethernet address, then edit your new config entry to bind the
  2424.   card to the memory card driver, memory_cs.  Restart cardmgr to use the
  2425.   new updated config file.  You will need to know your card's hardware
  2426.   ethernet address.  This address is a series of six two-digit hex
  2427.   numbers, often printed on the card itself.  If it is not printed on
  2428.   the card, you may be able to use a DOS driver to display the address.
  2429.   In any case, once you know it, run:
  2430.  
  2431.        dd if=/dev/mem0a count=20 | od -Ax -t x1
  2432.  
  2433.   and search the output for your address.  Only the even bytes are
  2434.   defined, so ignore the odd bytes in the dump.  Record the hex offset
  2435.   of the first byte of the address.  Now, edit clients/pcnet_cs.c and
  2436.   find the hw_info structure.  You'll need to create a new entry for
  2437.   your card.  The first field is the memory offset.  The next three
  2438.   fields are the first three bytes of the hardware address.  The final
  2439.   field contains some flags for specific card features; to start, try
  2440.   setting it to 0.
  2441.  
  2442.   After editing pcnet_cs.c, compile and install the new module.  Edit
  2443.   /etc/pcmcia/config again, and change the card binding from memory_cs
  2444.   to pcnet_cs.  Follow the instructions for reloading the config file,
  2445.   and you should be all set.  Please send me copies of your new hw_info
  2446.   and config entries.
  2447.  
  2448.   If you can't find your card's hardware address in the hex dump, as a
  2449.   method of last resort, it is possible to ``hard-wire'' the address
  2450.   when the pcnet_cs module is initialized.  Edit /etc/pcmcia/config.opts
  2451.   and add a hw_addr= option, like so:
  2452.  
  2453.        module "pcnet_cs" opts "hw_addr=0x00,0x80,0xc8,0x01,0x02,0x03"
  2454.  
  2455.   Substitute your own card's hardware address in the appropriate spot,
  2456.   of course.  Beware that if you've gotten this far, it is very unlikely
  2457.   that your card is genuinely NE2000 compatible.  In fact, I'm not sure
  2458.   if there are _a_n_y cards that are not handled by one of the first two
  2459.   methods.
  2460.  
  2461.   66..33..  PPCCMMCCIIAA ffllooppppyy iinntteerrffaaccee ccaarrddss
  2462.  
  2463.   The PCMCIA floppy interface used in the Compaq Aero and a few other
  2464.   laptops is not yet supported by this package.  The snag in supporting
  2465.   the Aero floppy is that the Aero seems to use a customized PCMCIA
  2466.   controller to support DMA to the floppy.  Without knowing exactly how
  2467.   this is done, there isn't any way to implement support under Linux.
  2468.  
  2469.   If the floppy adapter card is present when an Aero is booted, the Aero
  2470.   BIOS will configure the card, and Linux will identify it as a normal
  2471.   floppy drive.  When the Linux PCMCIA drivers are loaded, they will
  2472.   notice that the card is already configured and attached to a Linux
  2473.   driver, and this socket will be left alone.  So, the drive can be used
  2474.   if it is present at boot time, but the card is not hot swappable.
  2475.  
  2476.   66..44..  WWhhaatt''ss uupp wwiitthh ssuuppppoorrtt ffoorr XXiirrccoomm ccaarrddss??
  2477.  
  2478.   A driver for Xircom ethernet and ethernet/modem cards is included in
  2479.   the current PCMCIA package, thanks to the work of Werner Koch.  I've
  2480.   set up a HyperNews forum specifically for discussion of Xircom driver
  2481.   development, at
  2482.   <http://hyper.stanford.edu/HyperNews/get/pcmcia/xircom.html>.
  2483.  
  2484.   For a long time, Xircom cards were not supported because Xircom had a
  2485.   company policy of not disclosing technical information about their
  2486.   cards.  However, they have relaxed their rules, and now, they do
  2487.   distribute driver information.
  2488.  
  2489.   77..  DDeebbuuggggiinngg ttiippss aanndd pprrooggrraammmmiinngg iinnffoorrmmaattiioonn
  2490.  
  2491.   77..11..  SSuubbmmiittttiinngg uusseeffuull bbuugg rreeppoorrttss
  2492.  
  2493.   The best way to submit bug reports is to use the HyperNews message
  2494.   lists on the Linux PCMCIA information site.  That way, other people
  2495.   can see current problems (and fixes or workarounds, if available).
  2496.   Here are some things that should be included in all bug reports:
  2497.  
  2498.   +o  Your system type, and the output of the probe command.
  2499.  
  2500.   +o  What PCMCIA cards you are using.
  2501.  
  2502.   +o  Your Linux kernel version, and PCMCIA driver version.
  2503.  
  2504.   +o  Any changes you have made to the startup files in /etc/pcmcia, or
  2505.      to the PCMCIA startup script.
  2506.  
  2507.   +o  All PCMCIA-related messages in your system log file.
  2508.  
  2509.   All the PCMCIA modules and the cardmgr daemon send status messages to
  2510.   the system log.  This will usually be something like /var/log/messages
  2511.   or /usr/adm/messages.  This file should be the first place to look
  2512.   when tracking down a problem.  When submitting a bug report, always
  2513.   include the contents of this file.  If you are having trouble finding
  2514.   your system messages, check /etc/syslog.conf to see how different
  2515.   classes of messages are handled.
  2516.  
  2517.   Before submitting a bug report, please check to make sure that you are
  2518.   using an up-to-date copy of the driver package.  While it is somewhat
  2519.   gratifying to read bug reports for things I've already fixed, it isn't
  2520.   a particularly constructive use of my time.
  2521.  
  2522.   If you do not have web access, bug reports can be sent to me at
  2523.   dhinds@hyper.stanford.edu.  However, I prefer that bug reports be
  2524.   posted to my web site, so that they can be seen by others.
  2525.  
  2526.   77..22..  IInntteerrpprreettiinngg kkeerrnneell ttrraapp rreeppoorrttss
  2527.  
  2528.   If your problem involves a kernel fault, the register dump from the
  2529.   fault is only useful if you can translate the fault address, EIP, to
  2530.   something meaningful.  Recent versions of klogd attempt to translate
  2531.   fault addresses based on the current kernel symbol map, but this may
  2532.   not work if the fault is in a module, or if the problem is severe
  2533.   enough that klogd cannot finish writing the fault information to the
  2534.   system log.
  2535.  
  2536.   If a fault is in the main kernel, the fault address can be looked up
  2537.   in the System.map file.  This may be installed in /System.map or
  2538.   /boot/System.map.  If a fault is in a module, the nm command gives the
  2539.   same information, however, the fault address has to be adjusted based
  2540.   on the module's load address.  Let's say that you have the following
  2541.   kernel fault:
  2542.  
  2543.   Unable to handle kernel NULL pointer dereference
  2544.   current->tss.cr3 = 014c9000, %cr3 = 014c9000
  2545.   *pde = 00000000
  2546.   Oops: 0002
  2547.   CPU:    0
  2548.   EIP:    0010:[<c2026081>]
  2549.   EFLAGS: 00010282
  2550.  
  2551.   The fault address is 0xc2026081.  Looking at System.map, we see that
  2552.   this is past the end of the kernel, i.e., is in a kernel module.  To
  2553.   determine which module, check the output of ``ksyms -m | sort'':
  2554.  
  2555.        Address   Symbol                            Defined by
  2556.        c200d000  (35k)                             [pcmcia_core]
  2557.        c200d10c  register_ss_entry                 [pcmcia_core]
  2558.        c200d230  unregister_ss_entry               [pcmcia_core]
  2559.                  ...
  2560.        c2026000  (9k)                              [3c574_cs]
  2561.        c202a000  (4k)                              [serial_cs]
  2562.  
  2563.   So, 0xc2026081 is in the 3c574_cs module, and is at an offset of
  2564.   0x0081 from the start of the module.  We cannot look up this offset in
  2565.   3c574_cs.o yet: when the kernel loads a module, it inserts a header at
  2566.   the module load address, so the real start of the module is offset
  2567.   from the address shown in ksyms.  The size of the header varies with
  2568.   kernel version: to find out the size for your kernel, check a module
  2569.   that exports symbols (like pcmcia_core above), and compare a symbol
  2570.   address with nm output for that symbol.  In this example,
  2571.   register_ss_entry is loaded at an offset of 0xc200d10c - 0xc200d000 =
  2572.   0x010c, while ``nm pcmcia_core.o'' shows the offset as 0x00c0, so the
  2573.   header size is 0x010c - 0x00c0 = 0x004c bytes.
  2574.  
  2575.   Back to 3c574_cs, our fault offset is 0x0081, and subtracting the
  2576.   0x004c header, the real module offset is 0x0035.  Now looking at ``nm
  2577.   3c574_cs.o | sort'', we see:
  2578.  
  2579.        0000002c d if_names
  2580.        0000002c t tc574_attach
  2581.        00000040 d mii_preamble_required
  2582.        00000041 d dev_info
  2583.  
  2584.   So, the fault is located in tc574_attach().
  2585.  
  2586.   In this example, the fault did not cause a total system lockup, so
  2587.   ksyms could be executed after the fault happened.  In other cases, you
  2588.   may have to infer the module load addresses indirectly.  The same
  2589.   sequence of events will normally load modules in the same order and at
  2590.   the same addresses.  If a fault happens when a certain card is
  2591.   inserted, get the ksyms output before inserting the card, or with a
  2592.   different card inserted.  You can also manually load the card's driver
  2593.   modules with insmod and run ksyms before inserting the card.
  2594.  
  2595.   For more background, see ``man insmod'', ``man ksyms'', and ``man
  2596.   klogd''.  In the kernel source tree, Documentation/oops-tracing.txt is
  2597.   also relevant.  Here are a few more kernel debugging hints:
  2598.  
  2599.   +o  Depending on the fault, it may also be useful to translate
  2600.      addresses in the ``Call Trace'', using the same procedure as for
  2601.      the main fault address.
  2602.  
  2603.   +o  To diagnose a silent lock-up, try to provoke the problem with X
  2604.      disabled, since kernel messages sent to the text console will not
  2605.      be visible under X.
  2606.  
  2607.   +o  If you kill klogd, most kernel messages will be echoed directly on
  2608.      the text console, which may be helpful if the problem prevents
  2609.      klogd from writing to the system log.
  2610.  
  2611.   +o  To cause all kernel messages to be sent to the console, for 2.1
  2612.      kernels, if /proc/sys/kernel/printk exists, do:
  2613.  
  2614.        echo 8 > /proc/sys/kernel/printk
  2615.  
  2616.   +o  The key combination <RightAlt><ScrLk> prints a register dump on the
  2617.      text console.  This may work even if the system is otherwise
  2618.      completely unresponsive, and the EIP address can be interpreted as
  2619.      for a kernel fault.
  2620.  
  2621.   +o  For 2.1 kernels configured with CONFIG_MAGIC_SYSRQ enabled, various
  2622.      emergency functions are available via special <Alt><SysRq> key
  2623.      combinations, documented in Documentation/sysrq.txt in the kernel
  2624.      source tree.
  2625.  
  2626.   77..33..  LLooww lleevveell PPCCMMCCIIAA ddeebbuuggggiinngg aaiiddss
  2627.  
  2628.   The PCMCIA modules contain a lot of conditionally-compiled debugging
  2629.   code.  Most of this code is under control of the PCMCIA_DEBUG
  2630.   preprocessor define.  If this is undefined, debugging code will not be
  2631.   compiled.  If set to 0, the code is compiled but inactive.  Larger
  2632.   numbers specify increasing levels of verbosity.  Each module built
  2633.   with PCMCIA_DEBUG defined will have an integer parameter, pc_debug,
  2634.   that controls the verbosity of its output.  This can be adjusted when
  2635.   the module is loaded, so output can be controlled on a per-module
  2636.   basis without recompiling.
  2637.  
  2638.   Your default configuration for syslogd may discard kernel debugging
  2639.   messages.  To ensure that they are recorded, edit /etc/syslog.conf to
  2640.   ensure that ``kern.debug'' messages are recorded somewhere.  See ``man
  2641.   syslog.conf'' for details.
  2642.  
  2643.   There are a few debugging tools in the debug_tools/ subdirectory of
  2644.   the PCMCIA distribution.  The dump_tcic and dump_i365 utilities
  2645.   generate complete register dumps of the PCMCIA controllers, and decode
  2646.   a lot of the register information.  They are most useful if you have
  2647.   access to a datasheet for the corresponding controller chip.  The
  2648.   dump_cis utility (dump_tuples in pre-3.0.2 distributions) lists the
  2649.   contents of a card's CIS (Card Information Structure), and decodes
  2650.   some of the important bits.  And the dump_cisreg utility displays a
  2651.   card's local configuration registers.
  2652.  
  2653.   The memory_cs memory card driver is also sometimes useful for
  2654.   debugging problems with 16-bit PC Cards.  It can be bound to any card,
  2655.   and does not interfere with other drivers.  It can be used to directly
  2656.   access any card's attribute memory or common memory.  Similarly for
  2657.   CardBus cards, the memory_cb driver can be bound to any 32-bit card,
  2658.   to give direct access to that card's address spaces.  See the man
  2659.   pages for more information.
  2660.  
  2661.   77..44..  //pprroocc//bbuuss//ppccccaarrdd
  2662.  
  2663.   Starting with 2.1.103 kernels, the PCMCIA package will create a tree
  2664.   of status information under /proc/bus/pccard.  The memory entry shows
  2665.   memory allocations for PC Card devices in a format similar to
  2666.   /proc/ioports.  Each socket also has its own subdirectory of status
  2667.   entries.  The info entry identifies the host controller and describes
  2668.   its capabilities.  The exca entry is a dump of the ``ExCA'' Intel
  2669.   i82365sl-compatible register set for that socket.  For CardBus
  2670.   bridges, the pci entry is a dump of the bridge's PCI configuration
  2671.   space, and the cardbus entry is a dump of the CardBus configuration
  2672.   registers.
  2673.  
  2674.   77..55..  WWrriittiinngg CCaarrdd SSeerrvviicceess ddrriivveerrss ffoorr nneeww ccaarrddss
  2675.  
  2676.   The Linux PCMCIA Programmer's Guide is the best documentation for the
  2677.   client driver interface.  The latest version is always available from
  2678.   hyper.stanford.edu in /pub/pcmcia/doc, or on the web at
  2679.   <http://hyper.stanford.edu/HyperNews/get/pcmcia/home.html>.
  2680.  
  2681.   For devices that are close relatives of normal ISA devices, you will
  2682.   probably be able to use parts of existing Linux drivers.  In some
  2683.   cases, the biggest stumbling block will be modifying an existing
  2684.   driver so that it can handle adding and removing devices after boot
  2685.   time.  Of the current drivers, the memory card driver is the only
  2686.   ``self-contained'' driver that does not depend on other parts of the
  2687.   Linux kernel to do most of the dirty work.
  2688.  
  2689.   In many cases, the largest barrier to supporting a new card type is
  2690.   obtaining technical information from the manufacturer.  It may be
  2691.   difficult to figure out who to ask, or to explain exactly what
  2692.   information is needed.  However, with a few exceptions, it is very
  2693.   difficult if not impossible to implement a driver for a card without
  2694.   technical information from the manufacturer.
  2695.  
  2696.   I have written a dummy driver with lots of comments that explains a
  2697.   lot of how a driver communicates with Card Services; you will find
  2698.   this in the PCMCIA source distribution in clients/dummy_cs.c.
  2699.  
  2700.   77..66..  GGuuiiddeelliinneess ffoorr PPCCMMCCIIAA cclliieenntt ddrriivveerr aauutthhoorrss
  2701.  
  2702.   I have decided that it is not really feasible for me to distribute all
  2703.   PCMCIA client drivers as part of the PCMCIA package.  Each new driver
  2704.   makes the main package incrementally harder to maintain, and including
  2705.   a driver inevitably transfers some of the maintenance work from the
  2706.   driver author to me.  Instead, I will decide on a case by case basis
  2707.   whether or not to include contributed drivers, based on user demand as
  2708.   well as maintainability.  For drivers not included in the core
  2709.   package, I suggest that driver authors adopt the following scheme for
  2710.   packaging their drivers for distribution.
  2711.  
  2712.   Driver files should be arranged in the same directory scheme used in
  2713.   the PCMCIA source distribution, so that the driver can be unpacked on
  2714.   top of a complete PCMCIA source tree.  A driver should include source
  2715.   files (in ./modules/), a man page (in ./man/), and configuration files
  2716.   (in ./etc/).  The top level directory should also include a README
  2717.   file.
  2718.  
  2719.   The top-level directory should include a makefile, set up so that
  2720.   ``make -f ... all'' and ``make -f ... install'' compile the driver and
  2721.   install all appropriate files.  If this makefile is given an extension
  2722.   of .mk, then it will automatically be invoked by the top-level
  2723.   Makefile for the all and install targets.  Here is an example of how
  2724.   such a makefile could be constructed:
  2725.  
  2726.        # Sample Makefile for contributed client driver
  2727.        FILES = sample_cs.mk README.sample_cs \
  2728.                modules/sample_cs.c modules/sample_cs.h \
  2729.                etc/sample etc/sample.opts man/sample_cs.4
  2730.        all:
  2731.                $(MAKE) -C modules MODULES=sample_cs.o
  2732.        install:
  2733.                $(MAKE) -C modules install-modules MODULES=sample_cs.o
  2734.                $(MAKE) -C etc install-clients CLIENTS=sample
  2735.                $(MAKE) -C man install-man4 MAN4=sample_cs.4
  2736.        dist:
  2737.                tar czvf sample_cs.tar.gz $(FILES)
  2738.  
  2739.   This makefile uses install targets defined in 2.9.10 and later
  2740.   versions of the PCMCIA package.  This makefile also includes a
  2741.   ``dist'' target for the convenience of the driver author.  You would
  2742.   probably want to add a version number to the final package filename
  2743.   (for example, sample_cs-1.5.tar.gz).  A complete distribution could
  2744.   look like:
  2745.  
  2746.        sample_cs.mk
  2747.        README.sample_cs
  2748.        modules/sample_cs.c
  2749.        modules/sample_cs.h
  2750.        etc/sample
  2751.        etc/sample.opts
  2752.        man/sample_cs.4
  2753.  
  2754.   With this arrangement, when the contributed driver is unpacked, it
  2755.   becomes essentially part of the PCMCIA source tree.  It can make use
  2756.   of the PCMCIA header files, as well as the machinery for checking the
  2757.   user's system configuration, and automatic dependency checking, just
  2758.   like a ``normal'' client driver.
  2759.  
  2760.   I will accept client drivers prepared according to this specification
  2761.   and place them in the /pub/pcmcia/contrib directory on my FTP server,
  2762.   hyper.stanford.edu.  The README in this directory will describe how to
  2763.   unpack a contributed driver.
  2764.  
  2765.   The client driver interface has not changed much over time, and has
  2766.   almost always preserved backwards compatibility.  A client driver will
  2767.   not normally need to be updated for minor revisions in the main
  2768.   package.  I will try to notify authors of contributed drivers of
  2769.   changes that require updates to their drivers.
  2770.  
  2771.   77..77..  GGuuiiddeelliinneess ffoorr LLiinnuuxx ddiissttrriibbuuttiioonn mmaaiinnttaaiinneerrss
  2772.  
  2773.   If your distribution has system configuration tools that you would
  2774.   like to be PCMCIA-aware, please use the *.opts files in /etc/pcmcia
  2775.   for your ``hooks.''  These files will not be modified if a user
  2776.   compiles and installs a new release of the PCMCIA package.  If you
  2777.   modify the main configuration scripts, then a fresh install will
  2778.   silently overwrite your custom scripts and break the connection with
  2779.   your configuration tools.  Contact me if you are not sure how to write
  2780.   an appropriate option script.
  2781.  
  2782.   It is helpful for users (and for me) if you can document how your
  2783.   distribution deviates from the PCMCIA package as described in this
  2784.   document.  In particular, please document changes to the startup
  2785.   script and configuration scripts.  If you send me the appropriate
  2786.   information, I will include it in the ``Notes about specific Linux
  2787.   distributions''.
  2788.  
  2789.   When building PCMCIA for distribution, consider including contributed
  2790.   drivers that are not part of the main PCMCIA package.  For reasons of
  2791.   maintainability, I am trying to limit the core package size, by only
  2792.   adding new drivers if I think they are of particularly broad interest.
  2793.   Other drivers will be distributed separately, as described in the
  2794.   previous section.  The split between integral and separate drivers is
  2795.   somewhat arbitrary and partly historical, and should not imply a
  2796.   difference in quality.
  2797.  
  2798.